Snowflake

This article describes how to create a connection to Snowflake using a SQL command.

To write your transformed data into a Snowflake table using SQLake, you must first create a connection that provides the appropriate credentials to access your database.

Syntax

CREATE SNOWFLAKE CONNECTION  
    <connection_identifier> 
    CONNECTION_STRING = '<connection_string>' 
    USER_NAME = '<user_name>'
    PASSWORD = '<password>' 
    [ MAX_CONCURRENT_CONNECTIONS = <integer> ]
    [ COMMENT = '<comment>' ]

Jump to

Connection options

CONNECTION_STRING — editable

Type: text

The connection string to use when connecting to the database.

Format:

jdbc:snowflake://<ACCOUNT_WITH_REGION>.snowflakecomputing.com?db=<DB_NAME>&warehouse=<WAREHOUSE_NAME>&role=<ROLE_NAME >

Where:

  • ACCOUNT_WITH_REGION.snowflakecomputing.com

    • The connection URL in Snowflake.

    • Example: snowflakedemo.us-east-2.aws.snowflakecomputing.com

  • DB_NAME

    • The name of the database to connect to.

  • WAREHOUSE_NAME

    • (Optional) The warehouse name. If not provided, the default warehouse is used. If no default warehouse exists, the CREATE CONNECTION command fails.

  • ROLE_NAME

    • (Optional) The name of the role to use when connecting. If not provided, the default role is used. If no default role exists, the CREATE CONNECTION command fails.

Read more about connection string arguments in Snowflake.

USER_NAME — editable with password

Type: text

The user to authenticate to the database with.

PASSWORD — editable with user_name

Type: text

The password for the user.

MAX_CONCURRENT_CONNECTIONS — editable

Type: integer

(Optional) The maximum number of concurrent connections to the database.

Limiting this may reduce the load on the database but could result in longer data latency.

COMMENT — editable

Type: text

(Optional) A description or comment regarding this connection.

Minimum example

CREATE SNOWFLAKE CONNECTION my_snowflake_connection
    CONNECTION_STRING = 'jdbc:snowflake://snowflakedemo.us-east-1.snowflakecomputing.com?db=DEMO_DB&warehouse=DEMO_WH&role=ADMIN'
    USER_NAME = 'your_user'
    PASSWORD = 'your_pass';

Full example

CREATE SNOWFLAKE CONNECTION my_snowflake_connection
    CONNECTION_STRING = 'jdbc:snowflake://snowflakedemo.us-east-1.snowflakecomputing.com?db=DEMO_DB&warehouse=DEMO_WH&role=ADMIN'
    USER_NAME = 'your_user'
    PASSWORD = 'your_pass'
    MAX_CONCURRENT_CONNECTIONS = 23
    COMMENT = 'snowflake connection example';

Last updated