sqb dag
Compiles the project and outputs the static DAG artifact. The artifact contains every node (source, seed, model, function), dependency edge, and check (test, audit, scenario) in your project as structured JSON. It is the bridge between SQLBuild and external orchestrators like Dagster.Usage
Flags
| Flag | Description |
|---|---|
--json | Print the full DAG artifact as JSON to stdout |
--no-sql-validation | Skip compile-time SQL syntax validation |
--vars | JSON object of project variable overrides |
--json, the command prints a summary:
Generating via compile
You can also generate the DAG artifact as part of a compile:SqlBuildProject.prepare() method in the Dagster integration uses this path.
Output format
The JSON artifact has this structure:Nodes
Each node represents a source, seed, model, or function:| Field | Description |
|---|---|
id | Unique identifier ({kind}:{name}) |
kind | source, seed, model, or function |
name | Resource name |
asset_key | Tuple used as the Dagster asset key (typically [schema, name] or [database, schema, name]) |
target | Warehouse identity (database, schema, name, qualified_name) |
path | Relative file path in the project |
description | Model or source description, if declared |
tags | Model tags |
columns | Column metadata (name, type, nullable, description) |
materialization_type | For models: view, table, incremental, or custom name |
language | For functions: sql or python |
return_kind | For functions: scalar or table |
arguments | For functions: argument name and type pairs |
Edges
Each edge is a dependency between two nodes:Checks
Each check represents a test, audit, or scenario:| Field | Description |
|---|---|
id | Unique check identifier |
kind | sql_test, audit, or scenario |
name | Check name |
checked_asset_ids | Node IDs this check is attached to |
path | Relative file path |
severity | For audits: error or warn |
mode | For tests: model, macro, udf, or table_fn |
assertion_names | For scenarios: names of __assert__ CTEs |
expected_model_names | For scenarios: names of __expected__ models |
fixture_refs | For scenarios: names of fixture sources, refs, and seeds |

