Snowflake
Connect & Ingest data from / to a Snowflake database
The following credentials keys are accepted:
host
(required) -> The hostname or account the instance (eg.pua90768.us-east-11
)user
(required) -> The username to access the instancedatabase
(required) -> The database name of the instancepassword
(required) -> The password to access the instanceschema
(optional) -> The default schema to userole
(optional) -> The role to access the instancewarehouse
(optional) -> The warehouse to usepasscode
(optional) -> Specifies the passcode provided by Duo when using multi-factor authentication (MFA) for login.authenticator
(optional) -> Specifies the authenticator to use to login.
Here is an example of setting a connection named
SNOWFLAKE
. We must provide the type=snowflake
property:$ sling conns set SNOWFLAKE type=snowflake host=<host> user=<user> database=<database> password=<password> role=<role>
# Or use url
$ sling conns set SNOWFLAKE url=snowflake://myuser:[email protected]/mydatabase?schema=<schema>&role=<role>
export SNOWFLAKE='snowflake://myuser:[email protected]/mydatabase?schema=<schema>&role=<role>'
- On top, click New Connection.
- Search for "Snowflake". Click on it.
- Input the needed information.
- Click Test to verify connectivity.
- Click Save to save the connection.
To allow Sling to access your database, we need to create a user with the proper privileges. Please follow the steps below:
- 1.Create a user
sling
(or whatever you prefer) by running:-- Need a Role for Sling userCREATE ROLE SLING_ROLE COMMENT = 'Role for Sling';GRANT ROLE SLING_ROLE to role SYSADMIN;-- Need a warehouse for Sling userCREATE WAREHOUSE SLING_WAREHOUSEWITHINITIALLY_SUSPENDED = TRUEAUTO_RESUME = TRUEWAREHOUSE_SIZE = xsmallWAREHOUSE_TYPE = STANDARDAUTO_SUSPEND = 60;GRANT ALL ON WAREHOUSE SLING_WAREHOUSE TO ROLE SLING_ROLE;CREATE USER slingPASSWORD='<password>'COMMENT='User for Sling'DEFAULT_ROLE='SLING_ROLE'DEFAULT_WAREHOUSE='SLING_WAREHOUSE';GRANT ROLE SLING_ROLE to user SLING; - 2.If you are planning to load data into this connection, grant the following privileges to that user:CREATE DATABASE SLING; -- or some other databaseGRANT ALL ON DATABASE SLING TO ROLE SLING_ROLE;USE DATABASE SLING;GRANT ALL ON SCHEMA PUBLIC TO SLING_ROLE;
- 3.If you are planning to extract data from this connection, you need to give permission to read the tables you'd like Sling to extract.-- Need this to read table & column namesGRANT SELECT ON SCHEMA <schema_name> TO SLING_ROLE;-- run this to grant SELECT permission to all tables in database `marketing` to role slingGRANT SELECT ON DATABASE marketing TO ROLE SLING_ROLE;
If your database instance is secured behind a cloud firewall, please whitelist the IP addresses listed here. We may not be able to establish a connection without this step.
Last modified 1mo ago