Skip to Content
We are live but in Staging 🎉
Data EnginesSQLRecipesOverview

Recipes

Self-contained, runnable scenarios. Every recipe leads with the SQL and shows how to send it from psql, psycopg or the dodil data CLI.

RecipeKey surfaceWhen you need it
Double-entry ledgerNUMERIC(18,2) · CHECK · REFERENCES · SELECT … FOR UPDATE · retry on 40001 · ADD IMMUTABLEMoney or anything else that must never be created, lost or edited after the books close.
Idempotent writes & retriesPK as idempotency key · ON CONFLICT DO NOTHING / DO UPDATE · RETURNING · which SQLSTATEs to retryWebhooks, queue consumers, any handler that may run twice.
Manual tableCREATE TABLE · INSERT / MERGE / UPDATE / DELETE · SELECT · compact · optimizeYou know the schema and push the data yourself. The SQL-first workflow end to end.
Pipeline-bound tableCreateTablePipeline · ingest rules · SELECTUnstructured documents land in the bucket and rows should appear on their own.
Time travel & restoreRESTORE TABLE … TO VERSION AS OF · vacuumRecover from a bad write, and know how the retention window bounds recovery.
CTAS & materializeCREATE TABLE … AS SELECT · INSERT … SELECT · CREATE OR REPLACE TABLEDerive tables from queries — in-database ETL.

Conventions

  • Postgres wire first — pg.uk-lon-1.dodil.io:5432, sslmode=require, dbname = the bare bucket name. It is the only path with prepared statements, COPY FROM STDIN, cursors, savepoints and statement_timeout. Endpoints and credentials: Connect.
  • dodil data sql sends the same SQL over gRPC; dodil data pg over the Postgres wire. The control-plane API (api.data.dodil.io) serves no table data.
  • Bucket placeholder is kb-prod. Tables are implicit per bucket; there is nothing to enable.
  • Example schema — most recipes use an events table with composite primary key (id, user_id), partition column event_type and a JSON payload; the ledger recipe has its own.