Files
aurorabot/shared/db/DrizzleClient.ts
syntaxbullet aac9be19f2
Some checks failed
Deploy to Production / test (push) Failing after 32s
Deploy to Production / build (push) Has been skipped
Deploy to Production / deploy (push) Has been skipped
feat: Add a script to simulate CI locally by setting up a temporary PostgreSQL database, running tests, and updating dependencies.
2026-01-30 16:30:26 +01:00

18 lines
629 B
TypeScript

import { drizzle } from "drizzle-orm/postgres-js";
import postgresJs from "postgres"; // Renamed import
import * as schema from "./schema";
import { env } from "@shared/lib/env";
const connectionString = env.DATABASE_URL;
// Disable prefetch to prevent connection handling issues in serverless/container environments
const client = postgresJs(connectionString, { prepare: false });
export const DrizzleClient = drizzle(client, { schema });
// Export the raw client as 'postgres' to match previous Bun.SQL export name/usage
export const postgres = client;
export const closeDatabase = async () => {
await client.end();
};