sqlbuild_project.toml- shared project configuration, committed to version controlsqlbuild_local.toml- local developer overrides, gitignored
sqlbuild_project.toml
A complete example:Required fields
Connection
Theconnection block is passed directly to the adapter. For DuckDB:
Targets
A target is a named build context - the schema, database, or connection you build against (for exampledev and prod). Targets let you build to different places from the same project. Each target can override:
| Field | Description |
|---|---|
schema | Schema for all models in this target |
database | Database for all models in this target |
connection | Override the base connection config |
vars | Target-specific project variables |
defer_sources_to | Target name to read managed source data from (see Loaders) |
reuse_from | Target name to reuse relations from when version identities match (see Planning: Reuse from production) |
reuse_hard_copy | Force a full data copy instead of zero-copy clone when reusing (default: false) |
clone | Clone policy (see below) |
Selecting a target
The active target is determined by (in order of precedence):--targeton the command line (highest priority)sqlbuild_local.tomltargetfielddefault_targetinsqlbuild_project.toml- No target (models build to the default schema)
Clone policies
Targets can declare whether they allow cloning to or from:Defaults
Project-wide model defaults. Any field you can set in aMODEL() header can be set here as a default:
MODEL() header.
Path defaults
Per-directory model defaults. Useful for applying different config to different parts of your project:models/staging/stg_orders.sql matches the models/staging path default.
Config layering order
Configuration is layered in this order, with later layers overriding earlier ones:- Project defaults (
defaults) - Path defaults (
path_defaults) - if the model’s path matches - MODEL() header - the model’s own config
tags [marts] in its header that matches a path default with tags [managed] will have both tags.
Settings
Global feature toggles:| Field | Default | Description |
|---|---|---|
sql_analysis | true | Enable SQL validation and static analysis at compile time |
virtual_environments | false | Enable virtual environments (versioned model outputs, promotion, rollback, state management). When false, the project runs in standard mode. |
query_change_tracking | true | Track query fingerprints for change detection |
sql_validation | true | Validate SQL syntax during compilation |
concurrency | 1 | Maximum parallel model execution (currently serial only) |
auto_load_sources | true | Automatically run source loaders before building dependent models during sqb build. See Loaders. |
table_promotion_mode | adapter default | staged (CTAS to staging, audit, then promote) or direct (CTAS directly to target) |
default_audit_severity | warn | Default severity for audits: warn or error |
default_audit_run_scope | final | Default run scope for audits: final or delta_and_final |
Table promotion mode
staged(default for most adapters): Materializes into a staging table, runs audits, then swaps into the target. If audits fail, the production table is untouched.direct: Creates the table directly at the target location. Audits run after materialization. Simpler but no pre-promotion safety net.
Project variables
Variables are simple string substitutions available in model SQL via the@@name syntax:
Janitor
Configuration for thesqb janitor command, which cleans up stale warehouse relations:
| Field | Default | Description |
|---|---|---|
enabled | false | Whether janitor is active |
retention_days | 30 | Only clean relations older than this many days |
delete_tracked_only | true | Only clean relations that appear in fingerprint tracking |
exclude_patterns | [] | Glob patterns for relations to skip |
Scenario
Configuration for scenario snapshot capture safety limits and local type overrides:| Field | Default | Description |
|---|---|---|
max_rows_per_relation | none | Maximum rows per captured relation |
max_total_rows | none | Maximum total rows across all relations in one scenario |
max_bytes_per_relation | none | Maximum JSONL bytes per relation file |
max_total_bytes | none | Maximum total JSONL bytes per scenario |
dbt
Configuration for running SQLBuild alongside an existing dbt project:| Field | Description |
|---|---|
project_dir | Path to the dbt project root (where dbt_project.yml lives) |
profiles_dir | Path to the directory containing profiles.yml |
target_path | Path to dbt’s target/ directory (where manifest.json is written) |
target | dbt target name override (optional) |
replay_on_change | Project-wide policy for rerunning changed dbt models: forward_only (default) or full (optional). See Change-aware builds. |
reuse_from.git_ref | Production-shaped git branch or tag whose built tables are reused (optional). See Reuse from production. |
reuse_from.generate_schema_name_override | Relative path under dbt/macros/ to the generate_schema_name macro used when compiling the reuse ref. |
Skills
Configuration for AI agent skill file installation:| Field | Default | Description |
|---|---|---|
targets | all targets | Which agent targets to install skill files for: opencode, claude, agents |
sqlbuild_local.toml
Local developer overrides. This file should be gitignored.| Field | Description |
|---|---|
target | Override which target is active for this developer |
adapter | Override the database adapter (e.g. use DuckDB locally while prod uses Snowflake) |
connection | Override connection config (merged on top of project + target connection) |
settings | Override global settings (only explicitly set fields take effect) |
vars | Developer-specific variable overrides (merged on top of project + target vars) |
sqlbuild_local.toml and it persists across sessions.
