Skip to content

Adapters

Snowflake

Snowflake adapter configuration for SQLBuild.

Snowflake requires the optional snowflake-connector-python dependency:

pip install 'sqlbuild[snowflake]'
# or
uv pip install 'sqlbuild[snowflake]'
adapter = "snowflake"
default_target = "dev"
[connections.warehouse]
account = "my_org-my_account"
user = "my_user"
password = "my_password"
role = "TRANSFORM_ROLE"
warehouse = "TRANSFORM_WH"
[targets.dev]
connection = "warehouse"
database = "ANALYTICS"
schema = "RAW"

Connection fields are passed directly to snowflake.connector.connect(). See the Snowflake Connector documentation for all available options, including key-pair authentication, OAuth, and SSO. Put the authoritative database and schema on the target.

On connect, SQLBuild applies the connection’s role and warehouse, then applies the active target’s authoritative database and schema. These ensure the session context is set correctly regardless of the user’s default settings.

Use multiple targets to reuse one Snowflake connection while selecting different authoritative databases and schemas:

adapter = "snowflake"
[connections.warehouse]
account = "my_org-my_account"
user = "my_user"
password = "my_password"
role = "TRANSFORM_ROLE"
warehouse = "TRANSFORM_WH"
[targets.prod]
connection = "warehouse"
database = "PROD_DB"
schema = "prod"
[targets.dev]
connection = "warehouse"
database = "DEV_DB"
schema = "dev"