Files
TREK/server/src/app-config/db-settings.ts
T
Isaias Tavares 2e3762afe1 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.
2026-11-17 23:03:33 +01:00

15 lines
670 B
TypeScript

/** The databases TREK can run on. MySQL and MariaDB are out of scope (server/CLAUDE.md). */
export type EngineId = 'sqlite' | 'postgres';
/**
* Which database this process runs on, as `deriveDb` reads it from
* `TREK_DB_URL`. The Postgres arm carries what its pool needs, so nothing
* downstream has to check the URL again.
*/
export type DbEngineSettings = { engine: 'sqlite' } | { engine: 'postgres'; url: string; poolMax: number };
/** The most connections the Postgres pool opens (`TREK_DB_POOL_MAX` is refused above it). */
export const DB_POOL_MAX_CEILING = 100;
/** The pool size when `TREK_DB_POOL_MAX` is unset. */
export const DB_POOL_MAX_DEFAULT = 10;