Skip to content

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

Open
onmax wants to merge 1 commit into
nuxt-hub:mainfrom
onmax:fix/db-hyperdrive-postgres-runtime
Open

fix(db): avoid reusing hyperdrive postgres client#895
onmax wants to merge 1 commit into
nuxt-hub:mainfrom
onmax:fix/db-hyperdrive-postgres-runtime

Conversation

@onmax

@onmax onmax commented Apr 11, 2026

Copy link
Copy Markdown
Contributor

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

vercel Bot commented Apr 11, 2026

Copy link
Copy Markdown

@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

pkg-pr-new Bot commented Apr 11, 2026

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

commit: e3e270b

@onmax

onmax commented Apr 13, 2026

Copy link
Copy Markdown
Contributor Author

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
@onmax onmax force-pushed the fix/db-hyperdrive-postgres-runtime branch from 2ad88c3 to e3e270b Compare June 30, 2026 05:26
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