Configuration
LeapSQL is configured via leapsql.yaml in your project root.
Project Settings
Directory paths for project assets:
| Field | Type | Default | Description |
|---|---|---|---|
models_dir | string | models | Path to models directory |
seeds_dir | string | seeds | Path to seeds directory |
macros_dir | string | macros | Path to macros directory |
Target Configuration
Database targets are defined under the targets key. Each target specifies how to connect to a database.
Common Options
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | Database type: duckdb, postgres, snowflake, bigquery |
schema | string | No | Default schema for models |
DuckDB
DuckDB is an embedded analytical database. It can run in-memory or persist to a file.
| Field | Type | Description |
|---|---|---|
database | string | File path (DuckDB) or database name |
DuckDB Example
yaml
targets:
dev:
type: duckdb
database: ./data/warehouse.duckdb
schema: main
# In-memory DuckDB (default)
memory:
type: duckdb
schema: mainPostgreSQL
PostgreSQL connection options:
| Field | Type | Default | Description |
|---|---|---|---|
host | string | - | Database host |
port | int | 5432 | Database port |
user | string | - | Database username |
password | string | - | Database password |
PostgreSQL Example
yaml
targets:
prod:
type: postgres
host: localhost
port: 5432
user: analytics
password: ${POSTGRES_PASSWORD}
database: warehouse
schema: analyticsSnowflake
Snowflake-specific connection options:
| Field | Type | Description |
|---|---|---|
account | string | Snowflake account identifier |
warehouse | string | Snowflake warehouse name |
role | string | Snowflake role to use |
Snowflake Example
yaml
targets:
prod:
type: snowflake
account: xy12345.us-east-1
user: ${SNOWFLAKE_USER}
password: ${SNOWFLAKE_PASSWORD}
database: ANALYTICS
warehouse: COMPUTE_WH
role: ANALYTICS_ROLE
schema: PUBLICFull Configuration Example
yaml
# LeapSQL Configuration
# leapsql.yaml
# Project directories
models_dir: models
seeds_dir: seeds
macros_dir: macros
# Default target to use
default_target: dev
# Database targets
targets:
dev:
type: duckdb
database: ./data/dev.duckdb
schema: main
params:
extensions:
- httpfs
- parquet
staging:
type: postgres
host: staging-db.example.com
port: 5432
user: leapsql
password: ${STAGING_DB_PASSWORD}
database: analytics
schema: staging
prod:
type: postgres
host: prod-db.example.com
port: 5432
user: leapsql
password: ${PROD_DB_PASSWORD}
database: analytics
schema: publicEnvironment Variables
Use ${VAR_NAME} syntax to reference environment variables in your configuration:
yaml
targets:
prod:
type: postgres
password: ${POSTGRES_PASSWORD}