sqb build
Compiles, plans, and executes the build lifecycle. By default, only stale work runs; unchanged models, seeds, audits, and Python nodes are skipped automatically. Use--no-tests and --no-audits to skip validation for fast iteration.
Usage
Flags
| Flag | Description |
|---|---|
--force | Override change detection and build all selected models regardless of state |
--no-tests | Skip SQL unit tests |
--no-audits | Skip audits |
--no-python | Skip read-side Python tasks and assets (loader-side Python still runs for selected sources) |
--no-sql-validation | Skip compile-time SQL syntax validation |
--full-refresh | Drop and rebuild all selected models from scratch |
--defer-to | Resolve unselected model references against another target |
--defer-sources-to | Read managed source data from another target |
--fail-fast | Stop on first failure and skip remaining nodes |
--concurrency | Number of worker connections (default: 1) |
--verbose, -v | Show lifecycle SQL inline after each model |
--start-cursor-ts | Override start cursor for timestamp incremental models (ISO format) |
--end-cursor-ts | Override end cursor for timestamp incremental models (ISO format) |
--start-cursor-int | Override start cursor for integer incremental models |
--end-cursor-int | Override end cursor for integer incremental models |
--load | Explicitly load managed sources before building |
--no-load | Skip automatic source loading |
--reload | Reload managed sources (passes is_reload=True to loaders) |
--include-stale-upstreams | Expand selection to include stale upstream models needed for coherence |
--select, -s | Select specific models |
--exclude | Exclude specific models |
Fast iteration
Use--no-tests and --no-audits to skip validation when you only want to materialize models:
sqb run command. The full lifecycle (tests + audits) is always the default; skip flags opt out of specific phases when you need speed.
Execution order
- Managed sources are loaded (unless
--no-load) - Seeds are loaded (if changed)
- Source audits run before their dependent models (unless
--no-audits) - SQL unit tests run before their target model (unless
--no-tests) - Models are materialized in DAG topological order (unchanged models are skipped)
- Error-severity audits run against the staging table before promotion to the target (unless
--no-audits)
Output
Deferred builds
Use--defer-to to resolve unselected model references against another target. This lets you build a subset of models in dev while referencing production tables for everything else:
manifest.json is required. Deferred references resolve directly against the live target.
Failure behavior
When a model fails:- Downstream models are automatically blocked and skipped
- Staging/delta tables are retained for inspection
- Failure details show the model name, failed phase, and error message
Fingerprints
After a successful build, SQLBuild writes version identities to_sqlbuild_fingerprints in the target schema. These are used on subsequent runs to detect changes and skip unchanged work. See Planning and Change Detection for details.
Runtime artifacts
Build writes executed lifecycle SQL totarget/run/models/. These files contain the actual SQL that was executed, including resolved cursor bounds and runtime substitutions.
