Skip to content

run

Execute SQL models in dependency order.

By default, runs all discovered models. Use --select to run specific models. Use --downstream to also run models that depend on the selected models.

Output adapts to environment:

  • Terminal: Animated progress with spinner
  • Piped/Scripted: Static progress messages

Usage

bash
leapsql run [flags]

Aliases

  • build

Options

OptionShortDefaultDescription
--downstreamfalseInclude downstream dependents when using --select
--jsonfalseOutput as JSON lines for progress tracking
--select-sComma-separated list of models to run

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
# Run all models
leapsql run

# Run specific models
leapsql run --select staging.stg_customers,staging.stg_orders

# Run a model and its downstream dependents
leapsql run --select staging.stg_customers --downstream

# Run with JSON output for CI/CD integration
leapsql run --json

Released under the MIT License.