Only an admin can set up the Snowflake integration.

Connecting Soal to your Snowflake instance allows users to run sql queries in notebooks and allows Soal to suggest queries using AI.

Step 1. Create a Snowflake user

You can run the following script. Make sure you fill out your database name, warehouse and a password in the script:

use role ACCOUNTADMIN;
 
set database_name = '--YOUR DATABASE NAME--';
set warehouse_name = '--YOUR WAREHOUSE NAME--';
set soal_user = 'SOAL_USER';
set soal_role = 'SOAL_ROLE';
 
create user if not exists identifier($soal_user) password='--YOUR PASSWORD--';
create role if not exists identifier($soal_role);
grant role identifier($soal_role) to user identifier($soal_user);
 
-- grant Soal role access to warehouse
grant USAGE on warehouse identifier($warehouse_name)
to role identifier($soal_role);
 
-- grant Soal access to database
grant MONITOR, USAGE  on database identifier($database_name) to role identifier($soal_role);
grant USAGE on all schemas in database identifier($database_name) to role identifier($soal_role);
grant SELECT on all tables in database identifier($database_name) to role identifier($soal_role);
grant SELECT on future tables in database identifier($database_name) to role identifier($soal_role);

Step 2. Whitelist Soal’s IP Addresses

Soal will connect to your database from the following IP addresses. Please make sure to allow traffic from these IPs by editing the Network Policies in your Snowflake Account:

  • 00.000.000.000

Step 3. Create a Snowflake database connection in Soal

First, go to your Soal DB Connections (Workspace -> Integrations) page using the left side panel.

Click Create + and fill out the fields below

  • Name: What you would like to call this specific database connection.
  • Account: Your snowflake account identifier(opens in a new tab) is provided by Snowflake and included in the start of the URL you use to login to Snowflake: <account_identifier>.snowflakecomputing.com.
  • User: The Snowflake user. Best practice is to have a service user specifically dedicated to Soal.
  • Password: The password used to login to Snowflake.
  • Database: The Snowflake database to use. Databases correspond with logical groupings of tables and views in Snowflake.
  • Schema: optional If you provide a schema, we will limit listed tables in the model builder to this schema. If you need to limit permissions to a specific schema, you should do this with Snowflake permissions.
  • Warehouse: The warehouse to use in Snowflake. Warehouses correspond with compute resources.
  • Role: You must specify a role to be assumed when connecting from Soal. See Snowflake’s roles(opens in a new tab) documentation.
Account identifier format may differ based on Snowflake account age. For example, older Snowflake accounts often have identifiers that look like <account_locator>.<region>.<cloudprovider>, whereas newer Snowflake accounts have identifiers that look like <orgname>-<account_name>. For more details, visit Snowflake’s account identifier docs.