UNPKG

@clickup/pg-microsharding

Version:
11 lines (9 loc) 296 B
import { sql } from "./quote"; import { runSql } from "./runSql"; /** * Checks whether the given DSN is a master database. */ export async function isMasterDsn(dsn: string): Promise<boolean> { const result = await runSql.one(dsn, sql`SELECT pg_is_in_recovery()`); return result === "f"; }