mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-30 16:33:16 +00:00
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:
@@ -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],
|
||||
|
||||
Reference in New Issue
Block a user