Skip to main content
sqb dbt lineage traces dependencies across the combined dbt and SQLBuild graph:
  • Point it at a column (resource:column) to trace where that column’s values come from, or go, through every intermediate model.
  • Point it at a model (no colon) for the model-level dependency graph.
It compiles the dbt project, reads the manifest, and analyzes the SQL, so lineage works whether a node is a dbt model or a SQLBuild model, and traces straight across the boundary between them.

Column lineage

Target a column with resource:column (a colon between the model and the column):
Each hop is annotated with how the value was derived (direct, aggregation, expression, …), and the trace follows the column all the way back to the source - here through four models down to a seed. It also crosses the dbt/SQLBuild boundary: a SQLBuild column that reads a dbt model via __dbt_ref traces straight into the dbt model’s columns. See Column lineage for the full list of transform types and confidence levels. Use --direction downstream to trace the other way - every column derived from this one:
Column lineage supports --direction upstream (default) or downstream, but not both - the same restriction as the native sqb lineage command.
The dbt column target uses a colon (model:column); the native sqb lineage command uses a dot (model.column). The colon is used here because dbt model and package references already contain dots.

Model lineage

Target a model (no colon) for the model-level dependency graph:
The [dbt] / [sqb] tag on each node shows whether it is a dbt or SQLBuild resource. --direction both shows upstream and downstream together:

Options

The list and json formats keep fully-qualified resource names (e.g. model.jaffle_analytics.fct_orders) for unambiguous scripting; the tree format shortens them for readability. See Selection for how dbt and SQLBuild resources are named in the combined graph.