Merge pull request #346 from MODSetter/dev

vercel fix
This commit is contained in:
Rohan Verma 2025-09-30 22:46:57 -07:00 committed by GitHub
commit 5b26280b36
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2,5 +2,12 @@ import { drizzle } from "drizzle-orm/postgres-js";
import postgres from "postgres"; import postgres from "postgres";
import * as schema from "./schema"; import * as schema from "./schema";
const client = postgres(process.env.DATABASE_URL!); // Configure postgres client for Vercel serverless environment
const client = postgres(process.env.DATABASE_URL!, {
max: 1, // Limit connections for serverless (Vercel)
idle_timeout: 20, // Close idle connections after 20 seconds
max_lifetime: 60 * 30, // Close connections after 30 minutes
connect_timeout: 10, // Connection timeout in seconds
});
export const db = drizzle({ client, schema }); export const db = drizzle({ client, schema });