feat(cloudflare/hyperdrive): add read-only Ref resource for existing configs on v2 - #1345
Open
Franz1241 wants to merge 3 commits into
Open
feat(cloudflare/hyperdrive): add read-only Ref resource for existing configs on v2#1345Franz1241 wants to merge 3 commits into
Franz1241 wants to merge 3 commits into
Conversation
… configs A Hyperdrive.Ref binds an existing Hyperdrive configuration (created in the dashboard or by another system) by cloud id or name without ever managing its lifecycle: reconcile only observes the config and destroy only drops the state row. Exports findConfigByName from Connection so the ref shares the same name lookup.
Connect and the env-binding classifier accept a Hyperdrive.Ref wherever a managed Connection is accepted, lowering the same hyperdrive wire binding. In dev mode the ref contributes a local passthrough origin only when its dev override is set (the Cloudflare API never returns origin credentials of an existing config); the local worker provider rejects a dev deploy of a ref without one with an actionable error.
…verride Ref.test.ts creates a config out-of-band via distilled, references it by id and by name, binds it to a deployed Worker through both Connect and env, and asserts stack.destroy leaves the config untouched. The local test drives SQL through the dev-override passthrough under alchemy dev and asserts the real config survives destroy.
Author
|
Hey @sam-goodwin would love your help merging this when you get a chance. It brings back v1's HyperdriveRef on v2 |
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 #1343
Adds
Cloudflare.Hyperdrive.Ref, a read-only reference to an existing Hyperdrive config (created in the dashboard or owned by another system) with v1HyperdriveRefsemantics: deploys only observe the config, destroy only drops the state row, and it has nolist, sonuke/orphan GC can never touch the referenced config