- Reuse from production. Building a branch in dev usually rebuilds the whole project, even though most models are identical to production. SQLBuild compiles a production-shaped git branch, copies its already-built tables into your target, and seeds incremental models from a production baseline, so dbt only builds what your branch actually changed. See Reuse from production.
- Change-aware builds. SQLBuild fingerprints your dbt models in the warehouse and prunes the ones that have not changed, so a second build skips everything already current. See Change-aware builds.
SQLBuild reads your dbt manifest and drives the
dbt CLI as a subprocess. It never edits, patches, or moves files in your dbt project, and it does not reimplement Jinja, profiles, or dbt’s selection language. Your dbt project runs exactly as it does today.Start with your existing dbt project
From inside your dbt project, run asqb dbt command. Selection works exactly like dbt: scope to whatever you would normally build with --select, or omit it to plan the whole project.
sqlbuild_project.toml, it reads your dbt_project.yml and profile and creates a minimal twin project in a sqlbuild_project/ directory next to your dbt project. It reuses your dbt profile for the warehouse connection, so there are no separate credentials to configure.
sqlbuild_project.toml looks like this:
source = "dbt_profile" tells SQLBuild to connect using your dbt profile, so it talks to the same warehouse dbt does.
Run sqb dbt build --select path:models/marts once to build your selected dbt models with state recorded, then plan again. Once everything in the selection is current, the dbt side reports nothing to do:
sqb dbt build skips the dbt run entirely because nothing changed. Change one model and only that model, plus whatever depends on it, rebuilds.
How it works
- SQLBuild runs
dbt compileto produce amanifest.jsonwith model metadata - SQLBuild reads the manifest to understand dbt model names and their qualified warehouse tables
- SQLBuild resolves your
--select/--excludeagainst dbt by runningdbt ls, so dbt-native selectors likestate:modifiedandpackage:are evaluated by dbt itself, not reimplemented - SQLBuild plans which dbt models actually need to run, using warehouse-stored fingerprints and source freshness, and optionally reuses already-built relations from production
sqb dbt plan/run/build/testorchestrates the run: dbt builds only the models that changed, pruning everything that is current- (Optional) any SQLBuild models you have added run last, against the dbt outputs
dbt CLI directly: dbt compile for the manifest, dbt ls for selection, and dbt build/dbt run for execution.
Configuration
The auto-generated project above is editable, and you can writesqlbuild_project.toml by hand. The [dbt] block (shown in the generated project above) accepts:
| 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 | Production reuse configuration (optional). See Reuse from production. |
Prerequisites
- dbt must be installed and available on
PATH - Both projects must target the same warehouse and schema/database context
dbt compile automatically as part of sqb dbt plan/run/build/test to produce the manifest. You do not need to compile the dbt project manually.
On this topic
- Selection - how
--selectand--excluderoute work across both graphs. - Reuse from production - pull already-built tables from a production-shaped git branch instead of rebuilding.
- Change-aware builds - fingerprinting, cascade propagation, source freshness, and pruning unchanged dbt models.
- Adding SQLBuild models - optionally write SQLBuild models, tests, audits, and scenarios downstream of dbt.
- Testing and debug - mock dbt refs in unit tests,
sqb dbt test, andsqb dbt debug.

