Adapters
Snowflake
Snowflake adapter configuration for SQLBuild.
Snowflake requires the optional snowflake-connector-python dependency:
pip install 'sqlbuild[snowflake]'# oruv pip install 'sqlbuild[snowflake]'Connection config
Section titled “Connection config”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.
Session initialization
Section titled “Session initialization”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.
Shared connections across targets
Section titled “Shared connections across targets”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"