@clickup/pg-microsharding
Version:
Microshards support for PostgreSQL
14 lines (12 loc) • 334 B
text/typescript
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();
}
}