UNPKG

@clickup/pg-microsharding

Version:
28 lines (25 loc) 585 B
import type { TableInfo } from "./getTablesInSchema"; import { subName } from "./names"; import { ident, sql } from "./quote"; import { runSql } from "./runSql"; /** * Resumes the previously paused subscription. */ export async function enableSubscription({ toDsn, tables, schema, }: { toDsn: string; tables: TableInfo[]; schema: string; }): Promise<void> { if (tables.length === 0) { return; } await runSql( toDsn, sql`ALTER SUBSCRIPTION ${ident(subName(schema))} ENABLE`, "Resuming the destination subscription from the paused position", ); }