···1+import { Pool } from "pg";
2+import { attachDatabasePool } from "@vercel/functions";
3+import { DbPool } from "@vercel/functions/db-connections";
4+5+export const pool = new Pool({
6+ idleTimeoutMillis: 5000,
7+ min: 1,
8+ connectionString: process.env.DB_URL,
9+});
10+11+// Attach the pool to ensure idle connections close before suspension
12+attachDatabasePool(pool as DbPool);