mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-21 11:36:05 +00:00
2e3762afe1
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.
15 lines
670 B
TypeScript
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;
|