forked from syntaxbullet/aurorabot
feat: Add a script to simulate CI locally by setting up a temporary PostgreSQL database, running tests, and updating dependencies.
This commit is contained in:
@@ -1,13 +1,18 @@
|
||||
import { drizzle } from "drizzle-orm/bun-sql";
|
||||
import { SQL } from "bun";
|
||||
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;
|
||||
export const postgres = new SQL(connectionString);
|
||||
|
||||
export const DrizzleClient = drizzle(postgres, { schema });
|
||||
// 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 postgres.close();
|
||||
await client.end();
|
||||
};
|
||||
Reference in New Issue
Block a user