Repository navigation
feat(db-postgres): pool options, tested behind PgBouncer - #204
Merged
Merged
Conversation
Adds `prepare`, `statementTimeoutMs`, `idleTimeoutMs`, `connectTimeoutMs` and `applicationName` (default `PGAPPNAME`, then `easy-cms`). Only options that are set reach postgres.js, so the URL and PG* variables still apply. CI runs the Postgres integration suites through PgBouncer 1.26 in transaction mode with prepared statements off. The Databases guide (EN/TH) covers pool sizing, serverless and poolers. ADR-0055 and the roadmap use the `…Ms` names, like `busyTimeoutMs` of the SQLite adapter. Closes #155 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
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.
Closes #155 (M5, ADR-0055).
What changes
postgres()takesprepare,statementTimeoutMs,idleTimeoutMs,connectTimeoutMsandapplicationName. Timeouts are in ms, likebusyTimeoutMsofdb-sqlite.easy-cmsinpg_stat_activity, orPGAPPNAMEwhen that is set. postgres.js named thempostgres.jsbefore.?prepare=false) and thePG*variables still apply.CI
pgbouncerjob runs the Postgres integration suites through PgBouncer 1.26 in transaction mode, withprepare: false.postgresjob also checksapplication_name.Docs
The Databases guide (EN/TH) has a new Connections section:
max, kept under 10–20% ofmax_connectionsmaxprepare: falseunless the pooler keeps prepared statements (PgBouncer does from 1.24)statement_timeoutgoes on the role behind PgBouncerADR-0055 and the roadmap are updated to the
…Msnames.Verified locally (Docker: Postgres 17 + PgBouncer 1.26, transaction mode)
prepare: false: 349 passed; theapplication_nametest skips there.prepare: true: also passes on 1.26. The docs only promise this from 1.24.statement_timeoutstartup parameter ("unsupported startup parameter"), as the docs say.pnpm turbo run test --continue53/53, typecheck andbiome cipass.🤖 Generated with Claude Code