Install
ingestr alongside SQLBuild. The ingestr CLI must be available on PATH.
How it works
- Declare an
ingestrblock on a source insources/*.yml - SQLBuild generates a synthetic loader that calls
ingestr ingestas a subprocess - ingestr reads from the configured source and writes directly to the SQLBuild adapter’s database
- The destination URI is built automatically from your SQLBuild connection config - no manual destination setup

Example: PostgreSQL to DuckDB
Replicate a table from PostgreSQL into your local DuckDB project:sqb load or sqb build and ingestr copies the orders table into your project.
Example: Stripe with incremental merge
Load Stripe charges with incremental merge on a primary key:id column, using created to detect changes.
Configuration reference
Theingestr block on a source supports the following fields:
| Field | Required | Description |
|---|---|---|
source_uri | Yes | ingestr source connection URI (e.g. postgresql://..., stripe://..., shopify://...) |
source_table | Yes | Source table or resource name to ingest |
strategy | No | Ingestion strategy: replace, append, merge, delete+insert, or truncate+insert |
incremental_key | No | Column used for incremental change detection |
primary_key | No | Primary key column(s) for merge strategy (string or list) |
columns | No | Comma-separated column list to select from the source |
extra_args | No | Additional CLI arguments passed to ingestr ingest (list of strings) |
Strategy mapping
| Strategy | Behavior |
|---|---|
replace | Drop and recreate the destination table (default when no strategy is set) |
append | Insert all rows without deduplication |
merge | Upsert based on primary_key, using incremental_key for change detection |
delete+insert | Delete matching rows by incremental_key range, then insert replacements |
truncate+insert | Truncate destination table, then insert all rows |
Template variables
All string fields in theingestr block support SQLBuild project variable substitution and context templates:
sqlbuild_local.toml (gitignored):
Destination URI
SQLBuild automatically builds the ingestr destination URI from your adapter connection config. All supported adapters work without manual destination configuration:| Adapter | Destination URI format |
|---|---|
| DuckDB | duckdb:///path/to/db.duckdb |
| MotherDuck | motherduck://database |
| PostgreSQL | postgresql://user:pass@host:port/db |
| Snowflake | snowflake://user:pass@account/db/schema |
| BigQuery | bigquery://project |
| Databricks | databricks://token:...@host |
| SQL Server | mssql://user:pass@host:port/db |
Reload
When--reload is passed, ingestr runs with --full-refresh, forcing a complete reload regardless of the configured strategy:
Build integration
ingestr sources are managed sources - they participate in the same lifecycle as Python loaders:--load / --no-load / --reload flags.

