Getting Started
Introduction
SQLLoad loads data into your warehouse, and shows you how before it changes anything.
SQLLoad loads data into your warehouse, and shows you how before it changes anything.
| System | Source | Target |
|---|---|---|
| Postgres | ✓ (incl. CDC) | ✓ |
| Snowflake | ✓ | ✓ |
| BigQuery | ✓ | preview |
| Databricks | ✓ | |
| ClickHouse | preview | |
| DuckDB | ✓ | |
| MotherDuck | beta² | |
| Files | ✓ Parquet, CSV, JSON (S3, local folder, SFTP) | ✓ Parquet, CSV (S3, local folder) |
| Google Sheets | ✓ | |
| HTTP APIs and Python | ✓ | |
| ODBC databases¹ | ✓ |
¹ In the published wheels from 0.37.0 (not released yet); before that, in builds with the odbc feature.
² From 0.34.0, through a separate DuckDB 1.5 process: install sqlload[motherduck].
See the connector matrix for every combination and write strategy.
sqlload plan shows each table’s columns, write strategy and route before apply and load run.
Where Snowflake or DuckDB can load files exactly by itself, the files never pass through SQLLoad.
SQLLoad is written in Rust. Python is needed only for Python sources.
$ sqlload copy orders/ duckdb://shop.duckdb#raw.ordersPlan ready 1 selected, 1 object to create, 1 to load
Objects (1) sqlload apply└── raw.orders create table ├── order_id int -> BIGINT ├── customer text -> VARCHAR ├── total float -> DOUBLE ├── ordered_at timestamp_tz -> TIMESTAMP WITH TIME ZONE (stored as a UTC instant; the offset is not kept) └── + _sqlload_source_file, _source_version, _source_row, _load_id, _loaded_at
Loads (1) sqlload load└── orders replace ├── source files orders/ parquet ├── files 1 to read of 1 listed ├── route DuckDB reads directly from orders/ (nothing through the loader) └── batch 1 batch of whole partitions, up to 1,000 files or about 1 GB per commit; each batch's footers are combined, so later batches may add columns
✓ Plan complete 1 selected, 1 object to create, 1 to loadcreated raw.orders 9 columnsloaded raw.orders 3 rows 0.0s
✓ Completed 1 loaded, 3 rows, 0.0sWhat it does
Section titled “What it does”| Step | Command | Result |
|---|---|---|
| Check a project | sqlload debug |
Validates sqlload.toml and tests every connection. |
| Preview | sqlload plan |
Every table, column, type mapping, write strategy, route and cursor. Changes nothing. |
| Create tables | sqlload apply |
Creates or changes destination tables. Never loads data. |
| Load | sqlload load |
Loads the selected tables, committing large loads along the way. |
| Copy one table | sqlload copy |
One table, once, between two connections or URIs. No sqlload.toml needed. |
| Check declarations | sqlload contract |
Compares declared columns with live tables, or adopts live columns. |
| Logged positions | sqlload logged-state |
Inspects or corrects the run log of state = "logged" tables. |
How it stays honest
Section titled “How it stays honest”- The live table is the schema. SQLLoad stores no copy of your schema. Each run reads the destination table’s columns, or the columns you declare, and diffs them. See Contracts and schema changes.
- Cursors come from the data. An incremental table continues from the destination’s maximum
of its
cursor_column. Only positions the data can’t carry, such as an API sync token, go in an opt-in, append-only run log. See Cursors and state. - No silent fallbacks. A load method that can’t be used, or files a warehouse can’t load
exactly, fail at
planwith the fix, instead of quietly taking a slower route.