openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
22 lines (21 loc) • 1.01 kB
JavaScript
import { h as peekSqliteDatabaseAdmissionForPath } from "./sqlite-database-admission-DQIqro3d.mjs";
import { t as postgresPhysicalFactsKey } from "./physical-facts-contract-C_zPcdg6.mjs";
import { t as listDatabaseEngineStores } from "./registry-Dd7FIY0t.mjs";
import { r as preparePostgresBridge } from "./bridge-prestart-C7GHqvs8.mjs";
//#region src/infra/database-engine/bridge-prestart.ts
/** Overlap module loading only when the owner already supplied this store's identity. */
function prepareAdmittedPostgresBridge(e, t, n) {
if (!t?.postgres) return;
const r = peekSqliteDatabaseAdmissionForPath(e, postgresPhysicalFactsKey);
if (!r) return;
const i = listDatabaseEngineStores().find(({ id: e }) => e.replaceAll("-", "_") === r.store);
if (!i || t.effectiveEngines[i.id] !== "postgres") return;
return preparePostgresBridge({
url: t.postgres.connection,
schema: r.namespace,
storeId: r.storeId,
reuse: n?.reuse
}, n?.signal);
}
//#endregion
export { prepareAdmittedPostgresBridge };