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 asDATE_TRUNC('month', x); parts withEXTRACT('year' FROM x). - CTEs for the per-fact subqueries and a
FULL OUTER JOINwhen a query blends measures from two facts.
Configuration
local:
name: Local DuckDB
adapter: duckdb
tier: hot
file: ./data/analytics.duckdb
Connection fields
0sql never opens the file. file is carried as metadata for your own application, which runs the SQL it gets back; 0sql never uses it. A relative path resolves against the project directory. There is nothing secret to keep out of git.
Notes
- Expressions are DuckDB SQL.
quantile_cont,list_aggregate,strftimeand::casts all work inexpression.sql. - Same model, two adapters. A common layout is a
localDuckDB 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.