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
@@ -59,6 +59,7 @@
* plugin-runtime.service.ts's own comment at the wrap site) already ran inside a
* request context by the time this file's shared `runtime` finished booting.
*/
import { SqliteEngine } from '../../../src/db/engine/sqlite/sqlite-engine';
import { AuditLog } from '../../../src/db/entities/AuditLog.entity';
import { NotificationChannelPreferences } from '../../../src/db/entities/NotificationChannelPreferences.entity';
import { PluginActions } from '../../../src/db/entities/PluginActions.entity';
@@ -158,7 +159,7 @@ async function buildRuntime(registrar?: CronRegistrarService, orm?: TestOrm['orm
t.repo(Settings),
t.repo(NotificationChannelPreferences),
// Plan 4 Task 4: `uow` is no longer `@Optional()`.
new UnitOfWork(t.em),
new UnitOfWork(t.em, new SqliteEngine()),
undefined,
undefined,
orm,