lineage
Display the upstream dependencies and downstream dependents of a model.
The lineage shows how data flows through your models, helping you understand the impact of changes and debug data issues.
Output adapts to environment:
- Terminal: Styled tree with colored arrows
- Piped/Scripted: Markdown format (agent-friendly)
Usage
bash
leapsql lineage <model> [flags]Options
| Option | Short | Default | Description |
|---|---|---|---|
--depth | 0 | Max traversal depth (0 = unlimited) | |
--downstream | true | Include downstream dependents | |
--upstream | true | Include upstream dependencies |
Global Options
| Option | Short | Default | Description |
|---|---|---|---|
--config | config file (default: ./leapsql.yaml) | ||
--database | Path to DuckDB database (empty for in-memory) | ||
--env | Environment name | ||
--macros-dir | Path to macros directory | ||
--models-dir | Path to models directory | ||
--output | -o | Output format (auto|text|markdown|json) | |
--project-dir | -C | Project root directory (auto-detected from models-dir or config file location) | |
--seeds-dir | Path to seeds directory | ||
--state | Path to state database | ||
--target | -t | Target environment to use (e.g., dev, staging, prod) | |
--verbose | -v | false | Verbose output |
Examples
bash
# Show full lineage for a model
leapsql lineage staging.stg_customers
# Show only upstream dependencies
leapsql lineage staging.stg_customers --downstream=false
# Show only downstream dependents
leapsql lineage staging.stg_customers --upstream=false
# Limit traversal depth
leapsql lineage staging.stg_customers --depth 2
# Output as JSON
leapsql lineage staging.stg_customers --output json