dbt lineage
Lightweight visualizer for dbt core project's data lineage directly inside VS Code — no browser, no dbt Cloud, no context switching.
The extension renders an interactive upstream/downstream DAG for every model in your project, with one-click navigation between models, customizable colors, and live updates as you write SQL.
Features
Interactive lineage graph
Pan, zoom, and drag nodes freely. Double-click any model node to open the corresponding .sql file in the editor.
Focused and full-project views
- Focused mode — when you open a
.sql file, the graph automatically centers on that model and shows its lineage. Use the lock button in the bottom-right corner to stay focused.
- Full project mode — click the unlock button to see the entire project graph at once.
Direction toggle
In focused mode, cycle through three views using the direction button:
- Upstream & downstream — shows the full context of a model
- Upstream only — shows everything a model depends on
- Downstream only — shows everything that depends on a model
Node types
Each node shows its type, relative path, and materialization:
| Node |
Icon |
Label |
| Model |
Hexagon |
MDL |
| Seed |
File |
SED |
| Source |
Cylinder |
SRC |
Source nodes display the source schema and table name separately (e.g. Source: schema / table).
Materialization colors
The left strip of each node is color-coded by materialization type:
| Materialization |
Default color |
| Table |
Blue |
| View |
Purple |
| Incremental |
Orange |
| Ephemeral |
Grey |
| Materialized view |
Red |
| Source |
Green |
All colors are fully customizable via VS Code settings.
Live parser (optional)
Enable dbtLineage.enableLiveParser to extract ref() and source() calls directly from your .sql files on every save — no need to run dbt parse first. Useful when iterating quickly on new models.
Requirements
- A dbt project with a
dbt_project.yml in the workspace root
- A generated
target/manifest.json (run dbt parse or dbt run)
The extension activates automatically when a dbt_project.yml is detected in the workspace.
Extension Settings
| Setting |
Default |
Description |
dbtLineage.defaultDepth |
0 |
Number of hops to show from the focused model. 0 means unlimited. |
dbtLineage.enableLiveParser |
false |
Parse ref()/source() calls from .sql files in real-time, without needing to run dbt. |
dbtLineage.manifestPath |
"" |
Override path to manifest.json (relative to workspace root). Leave empty to auto-detect from target/manifest.json. |
dbtLineage.colors.source |
#1e8a65 |
Color for source nodes. |
dbtLineage.colors.table |
#216595 |
Color for models materialized as tables. |
dbtLineage.colors.view |
#9e94d5 |
Color for models materialized as views. |
dbtLineage.colors.incremental |
#db704b |
Color for incremental models. |
dbtLineage.colors.ephemeral |
#6b7280 |
Color for ephemeral models. |
dbtLineage.colors.materialized_view |
#b3013f |
Color for materialized views. |
Colors can be set in your settings.json:
{
"dbtLineage.colors.table": "#0ea5e9",
"dbtLineage.colors.view": "#8b5cf6",
"dbtLineage.colors.incremental": "#f59e0b"
}
Color changes apply immediately without reloading the extension.
Commands
| Command |
Description |
dbt Lineage: Focus on Current Model |
Centers the graph on the active .sql file |
dbt Lineage: Show Full Project Graph |
Switches to the full project view |
dbt Lineage: Refresh |
Reloads manifest.json from disk |
How it works
The extension reads your dbt project in two ways:
Manifest parser (default) — parses target/manifest.json generated by dbt. This gives full metadata: materialization, descriptions, tags, file paths, and pre-computed lineage. The graph updates automatically whenever the manifest changes.
Live parser (optional) — scans .sql files in models/ using regex to extract {{ ref() }} and {{ source() }} calls. Updates within 200 ms of a file save. Useful when actively developing new models that haven't been compiled yet.
When both are enabled, manifest metadata takes precedence and live-parsed edges are merged on top.
Tips
- The graph panel can be dragged from the bottom panel to the secondary sidebar (right side) for a side-by-side view alongside your SQL editor.
- Set
dbtLineage.defaultDepth to 2 or 3 to limit the graph to the most relevant hops when working in large projects.
- Enable the live parser during active development so new
ref() connections appear instantly as you type, without waiting for dbt parse.