Snowflake Adapter

Generate Snowflake SQL from your model.

What the adapter emits

  • Identifiers in "double quotes"; bare column names in expressions are lowercased, so quote a column that was created with a mixed-case name.
  • Date literals as '2026-01-01'::DATE; grain truncation as DATE_TRUNC('month', x); parts with YEAR(x), MONTH(x), DAYOFWEEK(x).
  • CTEs for the per-fact subqueries and a FULL OUTER JOIN when a query blends measures from two facts.

Configuration

snowflake_dw:
  adapter: snowflake
  name: Snowflake Data Warehouse
  tier: hot
  account_identifier: myorg-myaccount
  database: ANALYTICS_DB
  warehouse: COMPUTE_WH
  schema: PUBLIC
  role: ANALYST
  username: analyst
  # personal_access_token or private_key: never here; your application holds them

Connection fields

0sql never connects to Snowflake. account_identifier, database, warehouse, schema and role are carried as metadata for your own application, which runs the SQL it gets back. 0sql never uses them. If secrets do land in datasources.yml, zsql deploy strips password, private_key, personal_access_token, oauth_client_id and oauth_client_secret before building the archive.

Notes

  • Expressions are Snowflake SQL. approx_count_distinct, hll, median, listagg and iff are fine in expression.sql.
  • Qualify tables in physical_name (ANALYTICS_DB.PUBLIC.STORE_SALES) if your application’s session does not set a default database and schema.

Next Steps