Skip to content

Adapters

DuckDB

DuckDB adapter configuration for SQLBuild.

DuckDB is included as a core dependency. No extra installation needed.

adapter = "duckdb"
default_target = "dev"
[connections.local]
database = "my_project.duckdb"
[targets.dev]
connection = "local"
schema = "dev"
Field Description
database Path to the DuckDB database file. Use :memory: for in-memory databases.
extensions List of DuckDB extensions to install and load on connect.
settings Key-value pairs passed as SET statements on connect.
attach List of additional databases to attach.
[connections.local]
database = "my_project.duckdb"
extensions = ["httpfs", "parquet"]
[connections.local.settings]
memory_limit = "4GB"
[connections.local]
database = "my_project.duckdb"
[[connections.local.attach]]
path = "external_data.duckdb"
alias = "external"
read_only = true

DuckDB defaults to staged promotion: tables are materialized into a staging table, audited, then swapped into the target. This is configurable in settings:

[settings]
table_promotion_mode = "staged"