Skip to content

CLI Reference

plan

Preview what apply and load would do: every table, column, type mapping, write strategy, route and cursor. Changes nothing.

sqlload plan [SELECTOR ...] [OPTIONS]

sqlload plan prints what apply and load would do: tables to create or alter, each column’s type mapping, and each table’s write strategy, route, commits and cursor. It reads the catalogs and changes nothing. apply and load print the same plan before they run. See Projects.

In a Kafka exporter configuration, plan shows each topic’s table and the objects it needs, and refuses the options below.

A selector is a source name, a destination table name, or a source’s schema.table. Give selectors positionally or with --select, and leave tables out with --exclude. With none, every table is selected. See Selecting tables.

A source’s problems, such as a refused setting or a server it can’t reach, fail only a command that selects something from it, or that selects a table by name when the source can’t list its tables.

plan, apply and load take the same options.

Option Default Meaning
SELECTOR ..., -s, --select <SELECTOR>... all tables Sources or tables to select.
--exclude <SELECTOR>... none Sources or tables to leave out. Wins over --select.
--start-cursor <VALUE> none Read from this cursor value instead of the destination’s maximum, typed from each table’s cursor: an integer, an RFC 3339 timestamp or a date.
--end-cursor <VALUE> none Read only cursor values below this one.
--start-cursor-ts <TIMESTAMP>, --end-cursor-ts <TIMESTAMP> none The range for date and timestamp cursor tables only: an RFC 3339 timestamp or a date (a date cursor takes a date). Not with --start-cursor/--end-cursor. See Backfilling a range.
--start-cursor-int <INTEGER>, --end-cursor-int <INTEGER> none The range for integer cursor tables only. Combines with the -ts flags.
--reload off Rebuild the selected tables from the whole source, with the current columns and types. Asks first, unless --yes. See Reloading.
--resnapshot off postgres_cdc sources: drop and recreate the replication slot, then copy every table again. Asks first, unless --yes. See Postgres changes.
--yes off Don’t ask before --reload or --resnapshot. Needed when not on a terminal.
--follow off load of one postgres_cdc source only: keep streaming after catching up. Not with --reload, a cursor range, --sync-deletes, --fail-fast, --events, --events-file or --memory-per-table. See Following a Postgres CDC source.
--max-duration <DURATION> none With --follow: stop after this long, such as 10m, once the changes read so far are written.
--sync-deletes off After each selected table with deletes merges, mark its rows whose keys the source no longer holds. Fails when no selected table sets deletes. See Rows deleted at the source.
--allow-type-change-rebuild off Allow table rebuilds that type_change_rebuild = "require_confirmation" would block.
--concurrency <N> the project’s concurrency, else 4 The most tables loading at once.
--memory-limit <SIZE|off> the project’s memory_limit, else 80% of a container’s limit or 50% of memory The memory the run stays under, such as 4GiB, or off for no budget. See Memory budget.
--fail-fast off load: once a table fails, start no other table. See Stopping at the first failure.
--events jsonl, --events-file <PATH> off load: write each load event as one line of JSON, to stderr or to a file. See Events.
--progress <auto|always|never> auto load: when to draw the live block of running tables on stderr. See Events.
--memory-per-table off Linux only: load loads one table at a time and reports each table’s peak memory. See Peak memory.
-v, --verbose off Print every line of the plan. See Reading a plan.
--json off Print one JSON document on standard output: the plan, or for apply and load the result. See Results as JSON.

plan shows only the lines that are a table’s own or ask you to act, so a table that keeps every default takes one line:

$ sqlload plan
✓ Connected local DuckDB · app PostgreSQL 0.03s
✓ Discovered 3 tables in 2 sources 0.02s
Objects (3) sqlload apply
├── raw.app__customers create table, 6 columns
├── raw.app__orders create table, 7 columns
└── raw.events create table, 8 columns
Loads (3) into DuckDB local sqlload load
├── app postgres into raw
│ ├── customers merge on customer_id
│ └── orders merge on order_id updated_at: first run, everything
└── events ./lake/events/ into raw
└── events delete_insert on dt dt: first run, everything · 3 new of 3 files
└── route DuckDB reads directly from ./lake/events/ (nothing through the loader)
✓ Plan complete 3 objects to create, 3 to load

Loads names the target, then each source with its kind (or Python file or folder), the schema its tables land in when that isn’t the source’s name, and its target when there are several. A table’s line has its write strategy and key, where its read starts, and for a files table, after ·, how many of its files it reads. Once a table has rows, the read starts at the warehouse’s maximum:

$ sqlload plan
…
│ └── orders merge on order_id updated_at ≥ 2026-11-02 08:04:00+00 (max)
└── events ./lake/events/ into raw
└── events delete_insert on dt dt ≥ 2026-11-03 (max) · 1 new of 3 files
…

≥ means the bound row is read again, and > that it isn’t. Then comes where the bound is from: (max), (max − 5s) with a lookback, --start-cursor, or from state "…" (run 20d2b872) for logged state.

Each http connection gets a line with the limits every request to it shares in the run, its retries and its auth scheme, never its credentials:

http shop rate_limit 10/s, max_in_flight 4, retries 5, auth bearer

A child line under a table means it differs from the defaults, or needs a look:

Line Means
NULL cursors included, NULL cursors skipped null_cursor is set.
commits every 30 days The read commits after each window (batch_size).
repeated keys fail, newest by updated_at on_duplicate_keys = "fail", or newest_by.
route … (nothing through the loader) The warehouse reads the files itself.
memory ~1.9 GiB per fetch, over the 512 MiB fetch buffer An ODBC table’s row doesn’t fit its fetch buffer; the next line is the max_batch_memory that does.
deletes, transform, filter, flatten, parse, note The table’s own settings and notes.

Skipped tables get one line per reason:

Skipped (7)
├── no new files customers, prices, receipts, stock_counts, targets
└── up to date estimates (3 files), kpis (1 file)

-v shows every line, including the defaults each table follows and a new table’s columns one by one. With one table selected, it also shows key, columns and checks, and times to the millisecond:

$ sqlload plan -v app__orders
✓ Target connected local DUCKDB (0.02s)
✓ Source connected app POSTGRES (0.01s)
✓ Discovered app 2 tables (0.02s)
✓ Discovered events 1 table (0.00s)
Plan ready 1 selected, 1 to load
Loads (1) sqlload load
└── raw.app__orders merge (unique_key: order_id ← {primary_key})
├── source postgres app public.orders
├── route read as Arrow -> DuckDB takes Arrow
├── key order_id, the primary key the source reports (unique_key = "{primary_key}", sqlload.toml:22)
├── reads updated_at >= 2026-11-02 08:04:00.000+00 (warehouse maximum)
├── columns 5
└── commits once, at the end of the read (updated_at isn't read in order)
✓ Plan complete 1 selected, 1 to load
Section Lists
Objects Tables apply creates or alters. Under -v, each column as its portable type -> the warehouse type, with what that type loses in brackets (for an array, its own loss, then its elements’ after elements:), and added, widened, excluded and masked columns.
Loads Each table load loads, with its write strategy and source, key, reads, commits, files, schema, route, why, batch, memory, fetch, buffer and note lines. A plan of one table adds columns (with the names naming changes), names (see Naming) and checks, and key names the sqlload.toml line that sets unique_key.
Skipped Tables left out on purpose, with the reason: no new file (up to date: 0 new of 3 files in drop/orders/ (csv)), skip_tables_with_columns or new_tables = "skip". load reads nothing for them.
Errors Tables that can’t load as configured, with a short headline, the reason and the fix. A source that can’t be read is one item, with what it holds up under blocks.
Warnings Tables that load, but slower or with less than you might expect.

A table under Errors is left out; the others still run, and the command exits 1.

Some settings conflict, such as a merge without a unique_key, a cursor_column on replace, lookback with append, or a setting for another strategy. plan finds them in sqlload.toml and the Python sources before anything connects, lists every such table under Errors, and runs nothing. The command exits 1:

$ sqlload plan
Errors (2)
├── [sources.app.tables."public.customers"]
│ └── reason write_strategy = "replace" reloads the whole table, so it takes no cursor_column
└── [sources.app.tables."public.orders"]
└── reason write_strategy = "merge" needs a unique_key: the key columns, such as unique_key = ["id"], or unique_key = "{primary_key}" for the primary key the source reports
✗ Plan failed 2 errors

A source that sets them for all its tables and lists none is named [sources.NAME], and a Python table by its file, as Python table orders (sources/shop.py).

plan, and the plan apply and load start with, time each connection and each source’s discovery of its tables. When done, they collapse into two lines on standard error:

✓ Connected warehouse DuckDB · erp OpenEdge · app PostgreSQL 0.06s
✓ Discovered 17 tables in 9 sources 0.05s

A step that took a second or more keeps its own line, so a slow catalog stands out:

✓ Discovered erp 2 tables (21.30s)

A step that fails keeps its line too, as ✗ Source connection failed erp POSTGRES (after 30.01s).

  • -v prints every step’s line instead of the two summary lines.
  • A step still running writes a row every 30 seconds, such as erp listing tables RUNNING 30.0s, so logs that aren’t a terminal show it too.
  • Postgres and ODBC sources have a connection step; other sources connect within discovery.
  • --json and --log-format json leave the lines out. plan --json has the times under phases: one entry per connection ("phase": "connect") and discovery ("discover"), with its role (target or source), name, ok and elapsed_ms.
  • On a terminal, a spinner names a step that has run 300 ms, such as erp describing PUB.absence (2/5)… 18s. --progress never leaves it out.