Something went wrong. Try again.
a tool for shared writing and social publishing
Something went wrong. Try again.
TypeScript
at perf/paste
1234567891011121314import { Pool } from "pg";import { attachDatabasePool } from "@vercel/functions";import { DbPool } from "@vercel/functions/db-connections";
export const pool = new Pool({ idleTimeoutMillis: 5000, min: 1, max: 50, connectionString: process.env.DB_URL,});
// Attach the pool to ensure idle connections close before suspensionattachDatabasePool(pool as DbPool);