Skip to content

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

OptionShortDefaultDescription
--depth0Max traversal depth (0 = unlimited)
--downstreamtrueInclude downstream dependents
--upstreamtrueInclude upstream dependencies

Global Options

OptionShortDefaultDescription
--configconfig file (default: ./leapsql.yaml)
--databasePath to DuckDB database (empty for in-memory)
--envEnvironment name
--macros-dirPath to macros directory
--models-dirPath to models directory
--output-oOutput format (auto|text|markdown|json)
--project-dir-CProject root directory (auto-detected from models-dir or config file location)
--seeds-dirPath to seeds directory
--statePath to state database
--target-tTarget environment to use (e.g., dev, staging, prod)
--verbose-vfalseVerbose 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

Released under the MIT License.