everything-dev
Version:
A consolidated product package for building Module Federation apps with oRPC APIs.
37 lines • 1.73 kB
text/typescript
import { WorkspaceIdentity } from "./identity.mjs";
//#region src/db/binding.d.ts
/**
* The zero-config local database: a persistent, file-backed PGlite data dir
* resolved per workspace process (`.bos/db` relative to the workspace cwd).
* No ports, no docker — concurrent projects never collide. This default is a
* runtime-driver concern only: drizzle-kit commands (db:push/db:studio/
* db:migrate) need a real postgres DSN in the environment.
*
* Single-sourced in `defaults.json` (read by plain-node tooling like the
* regression env too) — never hardcode the literal elsewhere. Scaffolded
* templates and plugin secret defaults deliberately keep their own frozen
* copy: a database location is pinned at init, it must not silently follow
* a framework upgrade.
*/
declare const PGLITE_DEFAULT_URL: string;
/**
* Resolve the connection URL for a workspace identity.
*
* Resolution order:
* 1. the canonical secret in the provided environment
* 2. the canonical secret in the nearest `.env` walked up from the
* workspace directory (existing environment wins — values are not
* overridden, matching dotenv semantics)
* 3. the persistent local default (`PGLITE_DEFAULT_URL`) — consumed by the
* runtime driver (`createDatabaseDriver`), so boot migrations apply
* zero-config against the workspace's `.bos/db` data dir
*
* drizzle-kit commands need a postgres DSN; feeding them the pglite default
* fails loudly at connect time.
*/
declare function resolveDatabaseUrl(identity: WorkspaceIdentity, options?: {
env?: Record<string, string | undefined>;
}): string;
//#endregion
export { PGLITE_DEFAULT_URL, resolveDatabaseUrl };
//# sourceMappingURL=binding.d.mts.map