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
| Option | Short | Default | Description |
|---|---|---|---|
--downstream | false | Include downstream dependents when using --select | |
--json | false | Output as JSON lines for progress tracking | |
--select | -s | Comma-separated list of models to run |
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
# 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