Skip to content

fix(db): avoid reusing hyperdrive postgres client#895

Open
onmax wants to merge 4 commits intonuxt-hub:mainfrom
onmax:fix/db-hyperdrive-postgres-runtime
Open

fix(db): avoid reusing hyperdrive postgres client#895
onmax wants to merge 4 commits intonuxt-hub:mainfrom
onmax:fix/db-hyperdrive-postgres-runtime

Conversation

@onmax
Copy link
Copy Markdown
Contributor

@onmax onmax commented Apr 11, 2026

Summary

Fix the Cloudflare Hyperdrive postgres-js path to cache the Drizzle client per request instead of reusing a module-global client across Worker requests.

Scope is intentionally narrow:

  • only the Hyperdrive postgres-js branch changes
  • cache on useEvent().context
  • preserve current Hyperdrive option handling
  • leave other drivers and branches unchanged

Related

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 11, 2026

@onmax is attempting to deploy a commit to the NuxtLabs Team on Vercel.

A member of the Team first needs to authorize it.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 11, 2026

npm i https://pkg.pr.new/@nuxthub/core@895

commit: 77505ad

@onmax
Copy link
Copy Markdown
Contributor Author

onmax commented Apr 13, 2026

This also reproduces in https://github.com/nimiq/crypto-map on the Cloudflare runtime.

We hit failing DB-backed requests there with the Hyperdrive + postgres-js path, so this fix is relevant for a real downstream app as well.

@onmax onmax force-pushed the fix/db-hyperdrive-postgres-runtime branch from 487e7f6 to 77505ad Compare April 27, 2026 12:52
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