@clickup/pg-microsharding
Version:
Microshards support for PostgreSQL
14 lines (12 loc) • 427 B
text/typescript
import { createConnectedClient } from "../../internal/createConnectedClient";
import { libSchema } from "../../internal/names";
/**
* Creates a connected client to the test database.
*/
export async function createTestConnectedClient(
dsn: string,
): ReturnType<typeof createConnectedClient> {
const client = await createConnectedClient(dsn);
await client.query(`SET search_path = ${libSchema()}`);
return client;
}