> ## Documentation Index
> Fetch the complete documentation index at: https://kumo.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Snowflake Native App Connector

Kumo connects to your Snowflake data warehouse using a Snowflake Connector. Creating a Snowflake connector in Kumo requires the following steps:

### Step 1: Grant the privileges required

The following is the minimum set of privileges that should be granted to the Kumo Snowflake app to successfully create a Snowflake connector.

**Note**

1. The following commands should be run by a user who has `OWNERSHIP` or `WITH GRANT OPTION` privileges on the objects (warehouse, database, schema and tables) being granted access to.
2. The objects used in the commands (warehouse, database, and schema) must be the same as those used to create the connector (in Step 2 below).
3. See Warehouse sizing table [below](/spcs-snowflake-connector#snowflake-data-warehouse-sizing) for the size of the warehouse to use.

<CodeGroup>
  ```Text SQL theme={null}
  -- In the following, replace KUMOAPP_NAME, DB_NAME, SCHEMA_NAME and WAREHOUSE_NAME with
  -- those that will be used to build models with Kumo.

  SET KUMOAPP_NAME='<KUMOAPP_NAME>';
  SET DB_NAME='<DB_NAME>';
  SET SCHEMA_NAME='<DB_NAME>.<SCHEMA>';
  SET WAREHOUSE_NAME='<WAREHOUSE_NAME>';

  GRANT USAGE ON WAREHOUSE IDENTIFIER($WAREHOUSE_NAME) TO APPLICATION IDENTIFIER($KUMOAPP_NAME);

  GRANT USAGE ON DATABASE IDENTIFIER($DB_NAME) TO APPLICATION IDENTIFIER($KUMOAPP_NAME);
  GRANT USAGE ON SCHEMA IDENTIFIER($SCHEMA_NAME) TO APPLICATION IDENTIFIER($KUMOAPP_NAME);
  GRANT SELECT, REFERENCES ON ALL TABLES IN SCHEMA IDENTIFIER($SCHEMA_NAME) TO APPLICATION IDENTIFIER($KUMOAPP_NAME);
  GRANT SELECT, REFERENCES ON ALL VIEWS IN SCHEMA IDENTIFIER($SCHEMA_NAME) TO APPLICATION IDENTIFIER($KUMOAPP_NAME);
  GRANT SELECT, REFERENCES ON ALL MATERIALIZED VIEWS IN SCHEMA IDENTIFIER($SCHEMA_NAME) TO APPLICATION IDENTIFIER($KUMOAPP_NAME);
  GRANT CREATE TABLE ON SCHEMA IDENTIFIER($SCHEMA_NAME) TO APPLICATION IDENTIFIER($KUMOAPP_NAME);
  GRANT DROP TABLE ON SCHEMA IDENTIFIER($SCHEMA_NAME) TO APPLICATION IDENTIFIER($KUMOAPP_NAME);
  ```
</CodeGroup>

### Step 2: Creating the Snowflake connector

1. To set up a new Snowflake connector, click on **Connectors** in the left-hand column, followed by the **Configure Connector** button on the "Connectors" page.

<img src="https://mintlify.s3.us-west-1.amazonaws.com/kumoai/images/docs/6385453-image.png" alt="" />

2. On the "Snowflake Connector" window, provide a name for your Snowflake connector and add the following connection details. The necessary privileges (described [above](/spcs-snowflake-connector#step-1-grant-the-privileges-required)) must be are granted to the Kumo application before this step.

* **Account Identifier** - The account identifier uniquely identifies your Snowflake account. This should be provided as `ORGNAME-ACCOUNT_NAME`. The `ORGNAME` and `ACCOUNT_NAME` can be retrieved for your Snowflake account using the instructions [here](https://docs.snowflake.com/en/user-guide/admin-account-identifier#finding-the-organization-and-account-name-for-an-account).
* **Database** - The Snowflake database where the input relational data exists (same as the one in Step 1).
* **Warehouse** - The warehouse that will be used to read and process data in Snowflake (same as the one in Step 1).
* **Schema Name** - The schema under the Database where the input tables are to be loaded from (same as the one from Step 1 but should not be prefixed with the Database name).

Click on the **Done** button to save your new Snowflake connector.

<img src="https://mintlify.s3.us-west-1.amazonaws.com/kumoai/images/docs/0da36602fb93e0d5c4cdba80fcc27b51bf1e1f8d11137ac309659e1c9e9ec3ec-Screenshot_2024-11-04_at_2.06.18_PM.png" alt="" />

### Step 3 (Optional): Grant a user role the permission to access new tables and views created in the database/schema used by the Kumo app

<CodeGroup>
  ```Text SQL theme={null}
  -- Use ACCOUNTADMIN or a role with proper privileges
  USE ROLE ACCOUNTADMIN; -- or SECURITYADMIN with proper grants

  -- Create database role
  CREATE DATABASE ROLE if not exists <YOUR_DB>.kumo_db_role;

  -- Grant database and schema usage
  GRANT USAGE ON DATABASE <YOUR_DB> TO DATABASE ROLE <YOUR_DB>.kumo_db_role;
  GRANT USAGE ON SCHEMA <YOUR_DB>.<YOUR_SCHEMA> TO DATABASE ROLE <YOUR_DB>.kumo_db_role;

  -- Grant privileges on existing tables
  GRANT SELECT ON ALL TABLES IN DATABASE <YOUR_DB> TO DATABASE ROLE <YOUR_DB>.kumo_db_role;

  -- Grant future privileges (choose either database OR schema level)
  GRANT SELECT ON FUTURE TABLES IN DATABASE <YOUR_DB> TO DATABASE ROLE <YOUR_DB>.kumo_db_role;
  -- Schema level if needed 
  -- GRANT ALL ON FUTURE TABLES IN SCHEMA <YOUR_DB>.<YOUR_SCHEMA> TO DATABASE ROLE <YOUR_DB>.kumo_db_role;

  -- Grant the database role to the application
  GRANT DATABASE ROLE <YOUR_DB>.kumo_db_role TO APPLICATION <YOUR_KUMO_APP>;
  ```
</CodeGroup>

### Snowflake Data Warehouse Sizing

Kumo recommends the following data warehousing sizes for the Snowflake Native app based on the size of your largest table.

| Largest Table Size                      | Snowflake warehouse Size                                |
| --------------------------------------- | ------------------------------------------------------- |
| Up to 10 GB (10s of millions of rows)   | Medium                                                  |
| 10 to 100 GB (100s of millions of rows) | Large                                                   |
| Greater than 100GB                      | Currently not supported in Kumo's Snowflake Native app. |

***

* [Table of Contents](#)
* * [Step 1: Grant the privileges required](#step-1-grant-the-privileges-required)
  * [Step 2: Creating the Snowflake connector](#step-2-creating-the-snowflake-connector)
  * [Snowflake Data Warehouse Sizing](#snowflake-data-warehouse-sizing)
