Repository navigation
chore(npm): update dependency kysely-postgres-js to v5 - #266
renovate[bot] wants to merge 1 commit into
Conversation
[High risk] The reported P1 stands: v5 turns on prepared statements by default, and with postgres 3.4.8 that can accumulate prepared plans on long-lived reserved connections that are never recycled. The risk rests on a two-major jump in the database dialect that every service's queries run through, plus the ESM-only change and the raised Node requirement, which the review checked and found compatible. The lockfile resolves 5.0.1, not the 5.1.0 in the title. Not approved: confidence 3/5 is below the threshold of 4 Findings
SummaryUpgrades kysely-postgres-js from 3.0.0 to locked version 5.0.1.
Review context · 7 sources · 3/5 commands · 1 overlapping pull request
Reviews (1) · Last reviewed commit: "chore(npm): update dependency kysely-pos..." · openai/gpt-6.1-sol · $0.20 |
| kysely: 0.29.5 | ||
| kysely-pglite-dialect: ^1.4.0 | ||
| kysely-postgres-js: ^3.0.0 | ||
| kysely-postgres-js: ^5.0.0 |
There was a problem hiding this comment.
Disable prepared statements until connection lifetime eviction works · performance
For long-running API instances processing different repository-list lengths, this upgrade introduces persistent prepared-plan accumulation. RepositoryRepository.getByIds and reparent (packages/yucca-api/src/repositories/repository.repository.ts:100–105) generate distinct SQL for each IN list length, and all three database factories leave preparation enabled. Version 5 now explicitly prepares these queries. The locked postgres 3.4.8 caches each prepared statement, but its lifetime timer's end() does not terminate a reserved connection; the dialect reserves every connection, and releasing it returns it to the pool without completing that termination. Thus connections whose lifetime expires while reserved retain their plans instead of being recycled, increasing database memory over the service lifetime. This exact interaction is documented in upstream kysely-postgres-js issue #468 and is also present in the inspected 3.4.8 source.
Suggested fix
Set prepare: false in the postgres client defaults in all three packages/yucca-{api,admin-api,metrics-worker}/src/utils/database.ts factories before adopting v5, until the reserved-connection lifetime issue is fixed in the selected postgres version.
Prompt for a coding agent
In packages/yucca-api/src/utils/database.ts, packages/yucca-admin-api/src/utils/database.ts, and packages/yucca-metrics-worker/src/utils/database.ts, add `prepare: false,` to the options passed to postgres(), before the existing spread of caller options. Add a brief comment referencing kysely-org/kysely-postgres-js#468 explaining that preparation stays disabled until postgres reserved connections honor max_lifetime. Keep the dependency upgrade.
This PR contains the following updates:
^3.0.0→^5.0.0Warning
Some dependencies could not be looked up. Check the Dependency Dashboard for more information.
Release Notes
kysely-org/kysely-postgres-js (kysely-postgres-js)
v5.1.0Compare Source
Hey 👋
Postgres.js 4 is out, and this release lets you install it alongside the dialect without peer dependency warnings. The
postgrespeer range is now>= 3.4.0 < 5, and the test suite runs against both 3.x and 4.x on every Node.js and Bun version we support.Nothing changed in the dialect itself; everything it relies on behaves the same on 4. Postgres.js 4 does change a few things for your own queries though, such as letting the server decide parameter types by default, so have a look at its release notes when upgrading.
What's Changed
19ee1eaFull Changelog: kysely-org/kysely-postgres-js@v5.0.2...v5.1.0
v5.0.2Compare Source
Hey 👋
This patch brings the dialect in line with Kysely 0.29.8's transaction fixes for PostgreSQL.
Commits that PostgreSQL answers with
ROLLBACK, because an earlier statement error left the transaction aborted, now reject with Kysely'sAbortedTransactionErrorinstead of resolving as if committed. This requireskysely>= 0.29.8; on older versions the behavior is unchanged.A failed rollback, for example on a connection that died mid-transaction, now rejects with its own error. On
kysely>= 0.29.8 it previously threw aTypeErrorfrom the inherited core driver and hid the real cause.What's Changed
Full Changelog: kysely-org/kysely-postgres-js@v5.0.1...v5.0.2
v5.0.1Compare Source
Hey 👋
This patch fixes a regression introduced in v5.0.0 that prevented parameterless raw SQL batches, such as multiple
SET LOCALstatements, from running through this dialect.Parameterless raw and schema queries now use postgres.js's
unsafe()defaults. Query-builderSELECT,INSERT,UPDATE,DELETE, andMERGEqueries, plus any query with parameters, retain prepared execution. Instance-levelpostgres({ prepare: false })remains respected.What's Changed
Full Changelog: kysely-org/kysely-postgres-js@v5.0.0...v5.0.1
v5.0.0Compare Source
Hey 👋
This release fixes a misalignment of expectations in the dialect's driver with how people normally use
postgresand it's defaults which caused all queries to not use prepared statements and always re-plan.Now, this dialect prepares everything under the hood, but still respects
prepare: falseinpostgresinstance. This should somewhat speed up your recurring queries.What's Changed
Full Changelog: kysely-org/kysely-postgres-js@v4.0.0...v5.0.0
v4.0.0Compare Source
Hey 👋
Long time no see!
We got query cancellation now. ⏱️
We ship ESM only now. 🪶
What's Changed
cancel queryin Bun, supportkill session. by @igalklebanov in #461destroyafter first invocation. by @igalklebanov in #462resolvewhen using bun. by @igalklebanov in #463New Contributors
Full Changelog: kysely-org/kysely-postgres-js@v3.0.0...v4.0.0
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.