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
+14 -1
View File
@@ -1,4 +1,5 @@
import { openDatabase } from '../../../src/db/connection';
import { SqliteEngine } from '../../../src/db/engine/sqlite/sqlite-engine';
import { Places } from '../../../src/db/entities/Places.entity';
import { Trips } from '../../../src/db/entities/Trips.entity';
import { UnitOfWork } from '../../../src/nest/database/unit-of-work';
@@ -147,7 +148,19 @@ async function deleteTripAndWatchTempFiles(db: Database.Database): Promise<{
const none = undefined as never;
try {
const trips = new TripsService(none, none, none, none, none, none, none, none, new UnitOfWork(t.em), t.em, none);
const trips = new TripsService(
none,
none,
none,
none,
none,
none,
none,
none,
new UnitOfWork(t.em, new SqliteEngine()),
t.em,
none,
);
await trips.remove(trip.id, user.id, 'user');
return {
tempFiles: [...seen],