UNPKG

@clickup/pg-microsharding

Version:
14 lines (12 loc) 334 B
import { createConnectedClient } from "./createConnectedClient"; /** * Checks whether the given DSN is a master database. */ export async function isMasterDsn(dsn: string): Promise<boolean> { const client = await createConnectedClient(dsn); try { return await client.isMaster(); } finally { await client.end(); } }