Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.sqlbuild.com/llms.txt

Use this file to discover all available pages before exploring further.

MotherDuck uses DuckDB’s built-in md: connection support. No extra installation needed beyond the core DuckDB dependency.

Connection config

adapter = "motherduck"

[connection]
database = "my_database"
token = "your_motherduck_token"
FieldDescription
databaseMotherDuck database name. Automatically prefixed with md: if not already present. Defaults to md: (your default MotherDuck database).
tokenMotherDuck access token. Can also be set via environment variable.

Authentication

MotherDuck requires an access token. Generate one from the MotherDuck UI and pass it via the connection config or an environment variable:
[connection]
database = "my_database"
token = "${ENV:MOTHERDUCK_TOKEN}"

Per-environment connections

Use environments to separate production and development databases on MotherDuck:
adapter = "motherduck"

[connection]
token = "${ENV:MOTHERDUCK_TOKEN}"

[environments.prod]
schema = "prod"

[environments.prod.connection]
database = "prod_db"

[environments.dev]
schema = "dev"

[environments.dev.connection]
database = "dev_db"

Local development with DuckDB

Use sqlbuild_local.toml to override the adapter for local development against a plain DuckDB file:
adapter = "duckdb"

[connection]
database = "local_dev.duckdb"
This lets you develop and test locally with zero MotherDuck compute cost, then deploy to MotherDuck in production. SQLBuild’s scenario replay also runs locally in DuckDB regardless of the production adapter.