Repository navigation
feat(frontend): configure the Postgres pool from the environment - #183
Merged
thewealthyplace merged 1 commit intoOct 22, 2026
Merged
thewealthyplace merged 1 commit into
thewealthyplace merged 1 commit into
Conversation
The pool was built from DATABASE_URL alone, so a deployment could not raise its size, tune the idle timeout, or enable TLS for a managed Postgres. Read DATABASE_POOL_MAX, DATABASE_IDLE_TIMEOUT_MS and DATABASE_SSL instead, keeping pg's current values (10 connections, 10s idle, no TLS) as defaults and failing on invalid values rather than silently ignoring them. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
|
@codexhange Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
@luciusverus-cyber is attempting to deploy a commit to the thewealthyplace100-8633's projects Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
getPoolbuilt thepgPool fromDATABASE_URLalone, so pool size, idle timeout and TLS could not be configured and the frontend could not talk to a managed Postgres that requires TLS.The pool is now built by
poolConfigFromEnvfrom:DATABASE_POOL_MAX10DATABASE_IDLE_TIMEOUT_MS10000DATABASE_SSLfalsetrueverifies the server certificate,no-verifyencrypts without verifying (for providers whose CA is not in Node's trust store)Defaults are pg's own values, so deployments that set nothing behave exactly as before. Invalid values fail on first use with a clear error instead of being silently ignored or silently disabling TLS. All three are documented in
.env.exampleand passed through the compose frontend service, which now also acceptsDATABASE_URLso it can be pointed at a managed instance.Checks
npx tsc --noEmit— no errors in the touched files (the repo's pre-existing errors insrc/app/**and unrelated tests are unchanged)npm run linton the touched filesnpm test— the newpoolConfigFromEnvtests pass (7); the suite's other failures are pre-existing onmainnpm run build— fails onmainfor pre-existing type errors; not attempted hereI also probed the real wire behaviour against a local TCP server:
DATABASE_SSL=trueandno-verifymake pg send an SSLRequest, while the default sends a plain startup packet.Notes
frontend/src/lib/indexed-db.test.tspreviously importedgetLatestValues,getKeyHistoryandgetKeysByPrefix, which the module no longer exports, so the file could never pass. I replaced it with tests for the new pool config rather than leaving a dead test file next to the feature.Closes #38
closes #36
closes #39
closes #16