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;
}
