Skip to content

Commit 7f90236

Browse files
mack-erelclaude
andcommitted
docs(changeset): document where remote Hyperdrive credentials are seeded
The seeding step moved into the shared async paths, so the changeset now states which entry points seed edge credentials and what happens under the synchronous `unstable_getMiniflareWorkerOptions()` used by the Vite plugin and vitest-pool-workers. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015GDyTfEa62t3bSe5wWn8Mt
1 parent 1366373 commit 7f90236

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

.changeset/hyperdrive-remote-bindings-local-dev.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,8 @@ Hyperdrive bindings were local-only in `wrangler dev`, so exercising the databas
2020
}
2121
```
2222

23-
Miniflare stands up a local TCP bridge and points the binding's designator at it, relaying each connection to the edge Hyperdrive binding over the existing remote bindings proxy, so database clients such as `mysql2` and `pg` work unchanged. The edge session's connection string is fetched once per session so the local binding presents credentials the edge proxy accepts, which also makes `localConnectionString` optional whenever that session can be established. When it cannot — you are logged out, offline, or running with remote bindings turned off — the binding falls back to its `localConnectionString` with a warning, or explains what to fix if there is none. This is opt-in — bindings without `remote: true` keep the existing local-only behaviour and need no configuration changes.
23+
Miniflare stands up a local TCP bridge and points the binding's designator at it, relaying each connection to the edge Hyperdrive binding over the existing remote bindings proxy, so database clients such as `mysql2` and `pg` work unchanged. The edge session mints per-session credentials, so its connection string is fetched once per session and handed to the local binding — that is what lets a driver authenticate through the proxy, and it makes `localConnectionString` optional whenever the session can be established. When it cannot — you are logged out, offline, or running with remote bindings turned off — the binding falls back to its `localConnectionString` with a warning, or explains what to fix if there is none.
24+
25+
Credentials are seeded in `wrangler dev` (single- and multi-worker) and `getPlatformProxy()`. `unstable_getMiniflareWorkerOptions()` is synchronous and so cannot fetch them; a `remote: true` Hyperdrive binding used through it — for example under `@cloudflare/vite-plugin` or `@cloudflare/vitest-pool-workers` — warns that connections will likely fail to authenticate rather than failing silently.
26+
27+
This is opt-in — bindings without `remote: true` keep the existing local-only behaviour and need no configuration changes.

0 commit comments

Comments
 (0)