feat(db): run TREK on PostgreSQL

TREK runs on PostgreSQL when TREK_DB_URL is set, and on SQLite as before
otherwise: an engine port under src/db/engine, the dialect helpers under
src/db/dialect, a Postgres baseline for the migrations up to the cut,
pg_dump/pg_restore backups, a probe of every repository method against a
real server and a Postgres test lane in CI.
This commit is contained in:
Isaias Tavares
2026-11-05 01:15:21 -03:00
committed by Maurice
parent 17b47b38b9
commit 2e3762afe1
176 changed files with 6728 additions and 777 deletions
+6 -5
View File
@@ -6,7 +6,7 @@
* repositories. Nothing tested that claim until this probe. Given an empty
* Postgres database it
*
* 1. derives a Postgres schema from the entities (pg-probe/schema.ts);
* 1. derives a Postgres schema from the entities (src/db/engine/postgres/schema-adjust.ts);
* 2. runs every dialect helper on SQLite and on Postgres and checks both
* return what the helper promises (pg-probe/helper-cases.ts); every
* case must pass;
@@ -15,10 +15,11 @@
* (pg-probe/arg-samples.ts), through a MikroORM Postgres driver that
* runs each statement in its own rolled-back transaction and records
* whether Postgres accepted it (pg-probe/recorder.ts);
* 4. holds the statements Postgres refuses as SQL (SQLSTATE class 42 or
* 0A), per method, to scripts/pg-probe-baseline.json, which may only
* shrink (pg-probe/baseline.ts); a refusal over a sample value
* (class 22) or the empty tables is reported, not held;
* 4. holds the statements Postgres refuses as SQL or over a value's type
* (SQLSTATE class 42, 0A or 22), per method, to
* scripts/pg-probe-baseline.json, which may only shrink
* (pg-probe/baseline.ts); a constraint over a sample value (class 23) or
* the empty tables is reported, not held;
* 5. holds the methods whose SQL it did not see (it could not call them,
* they sent no SQL, or they timed out) to the same file's `uncovered`
* list, which may only shrink too, so a new method the probe cannot