Skip to content

[Susan (Grok Bot)] chore: dev.sh DB health check uses pgPoolConfig - #16

Merged
glindsay65 merged 1 commit into
developfrom
chore/dev-health-check-pg-config
Nov 3, 2026
Merged

glindsay65 merged 1 commit into
developfrom
chore/dev-health-check-pg-config

Conversation

@glindsay65

Copy link
Copy Markdown
Contributor

Authored by Susan (Grok Bot), not Grant.

Summary

The psql-missing fallback in scripts/dev.sh opened a raw pg.Pool from DATABASE_URL. Every other pool (src/lib/prisma.ts, scripts/sync-resume.ts, prisma/seed.ts) goes through pgPoolConfig(), which rewrites sslmode require / prefer / verify-ca to verify-full and sets enableChannelBinding when channel_binding=require.

  • Add scripts/check-db.ts and call it with npx tsx from that fallback. It builds new Pool(pgPoolConfig(process.env.DATABASE_URL)), runs SELECT 1, ends the pool, and exits 0 or 1.
  • stderr stays suppressed, and a non-zero status still triggers the existing "continue without a database?" prompt.
  • The psql branch is unchanged. The page-count check only uses psql and has no node-pg fallback, so it is unchanged.
  • A URL with no sslmode, including postgresql://localhost:5432/fdc_website, is still passed through unchanged. Version is unchanged.

Test plan

  • zsh -n scripts/dev.sh (script is zsh; sh -n is not the right check)
  • npx tsc --noEmit
  • npm run test:run (7 files, 61 tests)
  • DATABASE_URL=postgresql://127.0.0.1:1/fdc_website npx tsx scripts/check-db.ts exits 1 in under a second (connect ECONNREFUSED)
  • The same URL with stderr redirected to /dev/null still exits 1 and prints nothing
  • A Neon-shaped unreachable URL (sslmode=require&channel_binding=require) exits 1 the same way
  • Unset or empty DATABASE_URL exits 1 with DATABASE_URL is not set.
Open in Web Open in Cursor 

Route the psql-missing fallback in scripts/dev.sh through scripts/check-db.ts so it uses pgPoolConfig, matching the app pool on Neon URLs.

Authored-by: Susan (Grok Bot)
Co-authored-by: Grant Lindsay <glindsay65@users.noreply.github.com>
@vercel

vercel Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
website Ready Ready Preview Nov 3, 2026 8:52pm UTC

Request Review

@glindsay65
glindsay65 merged commit 2b0ccb2 into develop Nov 3, 2026
3 checks passed
@glindsay65
glindsay65 deleted the chore/dev-health-check-pg-config branch November 3, 2026 21:29

This branch was successfully deployed

1 active deployment
Preview — 6a316d1e Deployed Nov 3, 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.

2 participants