Commit Graph
7 Commits
Author SHA1 Message Date
aiongg f1e654b078 Typed Expression twins of the shared SQL-text fragments (hidden-repo filters, quiet PRs, public status, run columns, phase, current head, picks, manual only, tracked repos, open groups, command work, unsure review), checked against their text versions on SQLite and Postgres; pnpm test:pg runs the kx and portable tests by default 2026-11-21 20:34:26 +00:00
aiongg 53a7609f05 Merge G1: db copy and db verify in both directions with per-table digests; the copy migrates its target with migratePg 2026-11-21 18:34:44 +00:00
aiongg 423179c984 Merge E0: portable SQL helpers, the suite on Postgres (test:pg:suite), sqliteOnly skips 2026-11-21 18:32:16 +00:00
aiongg 14e447642b Item snapshot: build it from the Postgres app database through the Db handle (keyset-paged reads in one snapshot, one transaction into the local SQLite file); refreshSnapshot and the item-tools snapshot command work on either engine 2026-11-21 18:28:43 +00:00
aiongg cdad9b309a Portable SQL helpers (src/db/portable.ts) with tests on both dialects; pnpm test:pg:suite runs the SQLite suite on a throwaway Postgres: a test preload redirects connectDb on SQLite paths to per-path databases copied from a migrated template, dropped at exit, a reporter prints totals and failures per file; sqliteOnly skips for tests that need SQLite itself 2026-11-21 18:28:03 +00:00
aiongg d465403621 db copy: autocraft-server db copy|verify copies a whole database between SQLite and Postgres in either direction (schema without triggers, keyset-paged batched copy keeping rowid and identity values, sequences set from the source's counters, triggers installed after the rows through installPgTriggers, search index and review_blockers rebuilt on SQLite) and compares two databases by row counts and SHA-256 digests of canonical rows read through each side's Db; plain-text agent_run_texts are gzipped into bytea and compared unpacked; --replace, --skip-extra for retired tables and columns SQLite kept; pg-test.sh tmpfs size option 2026-11-21 18:13:15 +00:00
aiongg 4940e4d6ab Postgres engine for the Db handle: PostgresDialect on pg.Pool (pool size per process role, TLS verify-full to remote hosts, statement_timeout startup parameter, node:sqlite value shapes), reads as REPEATABLE READ READ ONLY snapshots, writes as READ COMMITTED under one advisory writer lock with lock_timeout, ? and :name rewritten to $n, query events on both backends; AUTOCRAFT_DB_URL selects Postgres (refused when AUTOCRAFT_DB differs); isLockTimeout/isConflict; scripts/pg-test.sh throwaway Postgres in Docker and pnpm test:pg; scripts/latency-proxy.ts; testDb helper and Postgres behaviour tests 2026-11-21 17:54:05 +00:00