Skip to main content
Inspect upstream and downstream dependencies for any model, source, seed, or function in your project. Supports both model-level lineage (dependency graph) and column-level lineage (tracing individual columns through transformations). Outputs as a tree, edge list, or structured JSON. sqb compile computes lineage for validation and includes per-model summaries in its JSON report. Use this command when you need to inspect or export the actual lineage graph.

Usage

Exactly one of a positional target or --select is required.

Flags

Model lineage

When the target is a plain resource name, lineage shows the model-level dependency graph.

Tree

The default. Shows an indented dependency tree with resource types and file paths:
Cycles and repeated nodes are annotated with “(already shown)” to avoid infinite recursion.

List

An edge list showing each dependency as a directed pair:

JSON

Structured output with nodes, edges, and metadata:

Column lineage

When the target uses model.column syntax, lineage traces the specific column through upstream or downstream transformations. Each edge is annotated with a transform type (direct, expression, aggregation, cast, star, constant) and a confidence level. See Column Lineage for a full explanation of transform types, confidence levels, and analysis modes.
Column lineage supports upstream and downstream directions (not both). The --mode flag selects the analysis mode: rich (default, full SQL analysis) or fast (lightweight, faster on large projects).

Tree

List

JSON

Examples

Depth limiting

--depth controls how many hops from the focus node(s) to include. In selector mode, --depth requires name, source, seed, or path-between selectors - it cannot be combined with tag or path selectors or comma-intersection selectors.