UNPKG

@clickup/pg-microsharding

Version:
13 lines 448 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isMasterDsn = isMasterDsn; const quote_1 = require("./quote"); const runSql_1 = require("./runSql"); /** * Checks whether the given DSN is a master database. */ async function isMasterDsn(dsn) { const result = await runSql_1.runSql.one(dsn, (0, quote_1.sql) `SELECT pg_is_in_recovery()`); return result === "f"; } //# sourceMappingURL=isMasterDsn.js.map