mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2026-06-19 11:55:30 -04:00
5a1636baa3
- Replace Biome with oxlint + oxfmt (OXC toolchain) for linting and formatting - Add .oxlintrc.json and .oxfmtrc.json configuration files - Update VS Code settings and devcontainer to use oxc-vscode extension - Remove contact form, Resend email integration, and related server action/schema - Remove unused UI components (accordion, alert, card, tabs, toggle, etc.)
23 lines
655 B
TypeScript
23 lines
655 B
TypeScript
import { attachDatabasePool } from "@vercel/functions";
|
|
import { drizzle } from "drizzle-orm/node-postgres";
|
|
import { Pool } from "pg";
|
|
|
|
import * as schema from "@/lib/db/schema";
|
|
|
|
// Create explicit pool instance for better connection management
|
|
const pool = new Pool({
|
|
connectionString: process.env.DATABASE_URL,
|
|
});
|
|
|
|
// Attach to Vercel's pool management to ensure idle connections are properly
|
|
// released before fluid compute functions suspend:
|
|
// https://vercel.com/guides/connection-pooling-with-functions
|
|
try {
|
|
attachDatabasePool(pool);
|
|
} catch {
|
|
// ignore
|
|
}
|
|
|
|
// Pass pool to Drizzle with schema
|
|
export const db = drizzle(pool, { schema });
|