S6 language-lane spec — PostgreSQL and SQLite
Engine on main: engine.New(m, "postgres" | "sqlite"), dialect differences in docs/dialects.md. The plan shape is unchanged; the executor differences are the ones below.
1. Deliverables (per language)
| item | what |
|---|---|
| driver per database | Go: pgx stdlib (github.com/jackc/pgx/v5/stdlib) and modernc.org/sqlite (pure Go, no cgo); Rust: sqlx features postgres, sqlite; PHP: pdo_pgsql, pdo_sqlite. The mysql://, postgres://, or sqlite:// DSN scheme selects it; compiler dialect metadata must match. |
$n renumbering | when expanding a parent slot to N placeholders on PostgreSQL, renumber every later $k in the statement text (the plan has one $k per slot in slot order); keep the pow2 padding rule |
| host-side codecs | aes: authenticated AES-256-GCM v2 with a 12-byte nonce and versioned key; hex: upper-case; ip: packed bytes on SQLite and text on read. The fixed AES vector is tests/codec/aes-vectors.json. |
| type mapping | booleans (PG boolean vs tinyint), datetime(6) as timestamp(6)/text, decimal as text→f64, JSON (PG jsonb), last insert id via RETURNING (the plan tells: InsertReturningID) |
| DDL for the bench schema | bench/sql/battle.pg.sql and bench/sql/battle.sqlite.sql generated from the manifest by ormgen ddl --dialect and checked in |
| conformance | the same 44 vectors must produce identical results across the three databases; statements differ by dialect, so the checker gains a --dialect dimension: tests/conformance/vectors.<dialect>.json recorded per database |
2. Rules
docs/lanes/s3.md §4. docker-compose for PostgreSQL is deploy/docker-compose.yml (integration lane); SQLite is a file under the scratch dir.