mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-23 05:21:15 +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:
@@ -14,6 +14,7 @@ import { resolveDataPaths } from './app-config/data-paths';
|
||||
// keeping the require after the restore keeps that true by construction.
|
||||
import type * as Bootstrap from './bootstrap';
|
||||
import { resolveDbPath } from './db/db-path';
|
||||
import { postgresTarget } from './db/engine';
|
||||
import { flushLogFileSync, logError } from './nest/audit/audit-log.logger';
|
||||
import type { DatabaseLifecycle } from './nest/database/database-lifecycle.service';
|
||||
import { ReadinessService } from './nest/health/readiness.service';
|
||||
@@ -150,6 +151,7 @@ async function restoreBeforeTheDatabaseOpens() {
|
||||
dbFile: resolveDbPath(),
|
||||
dataDir: paths.dataDir,
|
||||
reclaimResetFile: paths.reclaimResetFile,
|
||||
postgres: postgresTarget(env.db) ?? undefined,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user