SQLBuild includes a Dagster integration that maps your project’s models, sources, seeds, functions, tests, audits, and scenarios into Dagster assets and asset checks. SQLBuild handles the SQL transformation layer. Dagster handles scheduling, retries, alerting, and the asset-centric UI.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.
Try it
dagster/definitions.py that includes asset definitions, scenario checks, and a configured resource. Open the Dagster UI, materialize the assets, then run the scenario checks.
Install
dagster and dagster-webserver alongside SQLBuild.
How it works
sqb compile --daggenerates a staticsqlbuild_dag.jsonartifact with your project’s full graph (nodes, edges, checks)@sqlbuild_assets()reads the artifact and creates one DagsterAssetSpecper source, seed, model, and function, with dependency edges preservedSqlBuildCliResourceshells out tosqb build,sqb test,sqb scenario test, etc. as subprocesses- Execution results (materializations, audit pass/fail, scenario outcomes) are parsed from structured JSON and emitted as Dagster
MaterializeResultandAssetCheckResultevents
Quickstart
1. Generate the DAG artifact
target/sqlbuild_dag.json. The artifact is static and can be committed to version control or generated in CI.
2. Define assets and resource
3. Launch
sqb build invocation to those models via --select.
Asset selection
When you select a subset of assets in the Dagster UI, the integration automatically:- Maps selected Dagster asset keys back to SQLBuild model names using the DAG artifact
- Writes the selectors to a temporary file
- Passes
--select-fileto thesqbCLI so only the selected models are built
Checks
SQLBuild tests, audits, and scenarios are registered as Dagster asset checks:- Unit tests become checks attached to the models they test
- Audits become checks attached to the model or source they audit, with severity mapped to
AssetCheckSeverity.ERRORorAssetCheckSeverity.WARN - Scenarios become checks attached to the models they exercise
Scenarios as checks
Scenarios can be included as asset checks alongside tests and audits (the default), or run separately:Project preparation
SqlBuildProject.prepare() regenerates the DAG artifact by running sqb compile --dag. Use prepare_if_dev() to only regenerate during local development:
Translator
Customise how SQLBuild nodes map to Dagster assets by subclassingSqlBuildDagsterTranslator:

