seed
Load seed data from CSV files in the seeds directory into the database.
Seeds are typically used for reference data like country codes, status enums, or small lookup tables that don't change frequently.
Output adapts to environment:
- Terminal: Styled, colored output
- Piped/Scripted: Markdown format (agent-friendly)
Use --output to override: auto, text, markdown, json
Usage
bash
leapsql seedGlobal 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
# Load all seeds (auto-detect output format)
leapsql seed
# Load seeds as JSON
leapsql seed --output json
# Load seeds from a specific directory
leapsql seed --seeds-dir ./data/seeds