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
+13
View File
@@ -44,6 +44,7 @@ import {
dateOf,
dayDistance,
foundAgainState,
ilike,
lower,
lowerParam,
lowerTrim,
@@ -269,6 +270,18 @@ export const HELPER_CASES: readonly HelperCase[] = [
raw: (p) => rawOf(dayDistance(p, 'a', '2026-09-24')),
expect: { equals: 3 },
},
{
name: 'ilike matches in other case',
row: { a: 'Probe Place' },
raw: (p) => ({ sql: ilike(p, ['a']), params: ['%PLACE%'] }),
expect: { equals: true },
},
{
name: 'ilike keeps the escaped wildcard literal',
row: { a: 'Probe Place' },
raw: (p) => ({ sql: ilike(p, ['a']), params: ['probe\\_place'] }),
expect: { equals: false },
},
{
name: 'collateNoCase',
row: { a: 'Probe' },