Skip to content

fix(db): separate runtime pooling from migration connections - #174

Merged
f0rr0 merged 1 commit into
nextfrom
f0rr0/postgres-connections
Sep 28, 2026
Merged

f0rr0 merged 1 commit into
nextfrom
f0rr0/postgres-connections

Conversation

@f0rr0

@f0rr0 f0rr0 commented Sep 28, 2026

Copy link
Copy Markdown
Owner

Runtime Supabase URLs were silently changed from transaction mode (6543) to session mode (5432), so application instances could exhaust the 15-session pool and block deployment migrations.

Use Drizzle's node-postgres adapter with one shared runtime pool and Vercel's pool lifecycle integration. Preserve the configured endpoint, reject Supabase session URLs at runtime, and require an explicit direct/session DATABASE_URL_UNPOOLED for administration.

Run Drizzle's official migrator and its advisory lock on one dedicated connection, preserving the existing journal and lock key. Local migrations use the same runner. Update raw query consumers for node-postgres result shapes and document the connection setup.

Validation: 291 tests pass, along with lint/format/unused-code checks, typecheck, and the production build. Added configuration coverage requires neither Docker nor a running database.

Deployment: confirm DATABASE_URL uses transaction pooling and DATABASE_URL_UNPOOLED uses a reachable direct/session endpoint. Both production variables exist in Vercel, but their sensitive values could not be inspected. Older app instances may retain session connections until they retire.

@vercel

vercel Bot commented Sep 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
f0rr0-github-io Building Building Preview Sep 28, 2026 2:46pm UTC

@f0rr0
f0rr0 merged commit 7bcec71 into next Sep 28, 2026
3 of 4 checks passed
@f0rr0
f0rr0 deleted the f0rr0/postgres-connections branch September 28, 2026 14:48

This branch was successfully deployed

1 active deployment
Preview — 87825a3d Deployed Sep 28, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant