Files
heidi/lib/db
CatoandClaude e80c8ade18 fix(db): one connection pool per server process, not one per route bundle (#301)
Routes are built separately and each bundle that imports lib/db gets its
own copy of the module. The handle lived in a module variable, so each
copy opened its own pool of up to ten connections against a Postgres the
box shares between products. The deploy of #299 was refused at its schema
step with "too many clients already".

The pool now lives on globalThis under a registered symbol (the same fix
lib/auth/sender.ts needed), with its ceiling stated.

Claude-Session: https://claude.ai/code/session_019MDtmsxWVjuhCQowciDEYR

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-12 05:41:18 +01:00
..