@clickup/pg-microsharding
Version:
Microshards support for PostgreSQL
17 lines • 729 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.disableSubscription = disableSubscription;
const names_1 = require("./names");
const quote_1 = require("./quote");
const runSql_1 = require("./runSql");
/**
* Pauses the destination subscription. When resumed (enabled), the replication
* will continue from the paused position (no data loss).
*/
async function disableSubscription({ toDsn, tables, schema, }) {
if (tables.length === 0) {
return;
}
await (0, runSql_1.runSql)(toDsn, (0, quote_1.sql) `ALTER SUBSCRIPTION ${(0, quote_1.ident)((0, names_1.subName)(schema))} DISABLE`, "Pausing the destination subscription");
}
//# sourceMappingURL=disableSubscription.js.map