> For the complete documentation index, see [llms.txt](https://docs.whaly.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.whaly.io/warehouse/snowflake/giving-access-to-snowflake-data.md).

# Giving access to Snowflake data

By default, the Whaly platform only has access to data that was imported using Whaly connectors.

If you have data already stored inside your Snowflake account that you want to access within Whaly BI, you can do it using the following commands:

{% hint style="info" %}
Please run those commands with the `ACCOUNTADMIN` role to have the proper sharing rights!
{% endhint %}

### 1. Give access to Whaly BI to a Snowflake database

```
set whaly_bi_role = 'WHALY_BI_ROLE';
set snowflake_database = 'INSERT_PROPER_DATABASE_NAME_TO_EXPOSE_IN_WHALY_BI';

grant USAGE
    on database identifier($snowflake_database)
    to role identifier($whaly_bi_role);
```

This will get Whaly access to the database but not to the data stored inside it. Follow the next steps to give access to the proper part of the database to Whaly ⤵️

### 2. Wide access | Give access to Whaly BI to ALL Schemas and ALL Tables located in a Snowflake database

```
set whaly_bi_role = 'WHALY_BI_ROLE';
set snowflake_database = 'INSERT_PROPER_DATABASE_NAME_TO_EXPOSE_IN_WHALY_BI';

USE DATABASE identifier($snowflake_database);
grant USAGE
    on all schemas in database identifier($snowflake_database)
    to role identifier($whaly_bi_role);
grant SELECT 
    on all tables in database identifier($snowflake_database)
    to role identifier($whaly_bi_role);
grant SELECT 
    on future tables in database identifier($snowflake_database)
    to role identifier($whaly_bi_role);
```

{% hint style="info" %}
Whenever adding new schemas into your Snowflake database on which you to get access to Whaly, please run the following query :arrow\_down\_small:
{% endhint %}

```
set whaly_bi_role = 'WHALY_BI_ROLE';
set snowflake_database = 'INSERT_PROPER_DATABASE_NAME_TO_EXPOSE_IN_WHALY_BI';
set snowflake_schema = 'INSERT_PROPER_SCHEMA_NAME';

USE DATABASE identifier($snowflake_database);
grant USAGE
    on schema identifier($snowflake_schema)
    to role identifier($whaly_bi_role);
```

### 2bis. Granular access | Give access to Whaly BI to a SINGLE Schema and ALL its Tables located in a Snowflake database

```
set whaly_bi_role = 'WHALY_BI_ROLE';
set snowflake_database = 'INSERT_PROPER_DATABASE_NAME_TO_EXPOSE_IN_WHALY_BI';
set snowflake_schema = 'INSERT_PROPER_SCHEMA_NAME';

USE DATABASE identifier($snowflake_database);
grant USAGE
    on schema identifier($snowflake_schema)
    to role identifier($whaly_bi_role);
grant SELECT 
    on all tables in schema identifier($snowflake_schema)
    to role identifier($whaly_bi_role);
grant SELECT 
    on future tables in schema identifier($snowflake_schema)
    to role identifier($whaly_bi_role);
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.whaly.io/warehouse/snowflake/giving-access-to-snowflake-data.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
