Recipes
Self-contained, runnable scenarios for the patterns developers actually ship with K3 Tables. Every recipe is grounded in real SQL, real RPCs, real CLI commands, and the warehouse-compatible Scriptum catalog.
What’s here
| Recipe | Key surface | When you need it |
|---|---|---|
| Manual Table | CREATE TABLE · INSERT / MERGE / UPDATE / DELETE · SELECT · OptimizeTable · Compact | You have structured data + know the schema. SQL-first workflow end-to-end. |
| Pipeline-bound Table | CreateTablePipeline · ingest rules · SELECT | You have unstructured documents and want rows auto-extracted via a Scriptum template. Bridges Pipelines → Tables. |
| Time Travel & Restore | RESTORE TABLE … TO VERSION AS OF · VacuumTable | Recover from bad writes; understand the vacuum-retention window that bounds recovery. |
| CTAS & Materialize | CREATE TABLE … AS SELECT · INSERT … SELECT · CREATE OR REPLACE TABLE | Derive new tables from SQL queries — analytical ETL within K3. |
Conventions used in these recipes
- SQL-first. Table data, DDL and maintenance live on the tables data plane, and its native surface is SQL. Every recipe leads with a
sqlblock and shows how to send it —psql, psycopg, ordodil data sql/dodil data table …. The control-plane REST API (api.data.dodil.io) does not serve table data. - Postgres wire —
pg.uk-lon-1.dodil.io:5432,sslmode=require(the door terminates TLS;preferwould fall back to plaintext silently, and your password here is your API-key/service-account secret),dbname= the bare bucket name. This is the only path with prepared statements,COPY FROM STDIN, cursors, savepoints andstatement_timeout. - Tables HTTP door —
https://table.uk-lon-1.dodil.io, canonical pathPOST /v1/databases/{bucket}/sql/execute. Used where a raw HTTP client is genuinely the point. - Bucket placeholder is
kb-prod. Tables are implicit per bucket — there is no engine to enable. - Consistent example schema — most recipes use a fictional
eventstable with composite PK(id, user_id), partition columnevent_type, and a JSONpayloadcolumn. See Manual Table → step 1.
See also
- Tables — the SQL engine overview
- Connect & wire adapters — endpoints, credentials,
sslmode=require - Quickstart — first table + first INSERT + first query in 5 minutes
- Core Concepts — Table, Column, strategies, history
- SQL Compatibility — DuckDB dialect contract
- API Reference — full surface (Tables · Data · Execute · Maintenance · Templates)
- CLI Guide — every
dodil data tablecommand