DuckDB Adapter

Generate DuckDB SQL from your model. DuckDB is the usual choice for local development and tests: one file, no server, and the same model deploys unchanged against a warehouse adapter later.

What the adapter emits

  • Identifiers in "double quotes"; bare column names in expressions are lowercased.
  • Date literals as DATE '2026-01-01'; grain truncation as DATE_TRUNC('month', x); parts with EXTRACT('year' FROM x).
  • CTEs for the per-fact subqueries and a FULL OUTER JOIN when a query blends measures from two facts.

Configuration

local:
  name: Local DuckDB
  adapter: duckdb
  tier: hot
  file: ./data/analytics.duckdb

Connection fields

The server never opens the file: it has no database driver in it, and the deployed model keeps only adapter, tier and the name. zsql on this machine does open it, in process, for zsql catalog, zsql sample and zsql run — which makes DuckDB the quickest way to see the whole flow working, since there is no credential at all. A relative file path resolves against the project directory, and there is nothing secret to keep out of git.

Notes

  • Expressions are DuckDB SQL. quantile_cont, list_aggregate, strftime and :: casts all work in expression.sql.
  • Same model, two adapters. A common layout is a local DuckDB datasource for development and a warehouse datasource for production, with the same tables defined on both. The planner picks by tier and cost; see Semantic Routing.

Next Steps