Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

656 B
Raw Blame
import { buildOrmConfig, resolveEngine } from './db/engine';

/**
 * The MikroORM config for the CLI and the Nest container alike: the engine
 * `TREK_DB_URL` names (the SQLite file by default) and what every engine shares
 * (`db/engine/index.ts`).
 *
 * Built at module level, not from `DATABASE_ENGINE`, because the MikroORM CLI
 * loads this file without Nest. Only the engine's options come from it, and
 * those are plain values with no state, so it and the container's engine agree
 * on the database. The state an engine keeps (Postgres's reopen hook) exists
 * only on the container's instance.
 */
export default buildOrmConfig(resolveEngine());