Skip to content

feat(cloudflare/hyperdrive): add read-only Ref resource for existing configs on v2 - #1345

Open
Franz1241 wants to merge 3 commits into
alchemy-run:mainfrom
Franz1241:feat/hyperdrive-ref
Open

feat(cloudflare/hyperdrive): add read-only Ref resource for existing configs on v2#1345
Franz1241 wants to merge 3 commits into
alchemy-run:mainfrom
Franz1241:feat/hyperdrive-ref

Conversation

@Franz1241

Copy link
Copy Markdown

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 v1 HyperdriveRef semantics: deploys only observe the config, destroy only drops the state row, and it has no list, so nuke/orphan GC can never touch the referenced config

… 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.
@Franz1241

Copy link
Copy Markdown
Author

Hey @sam-goodwin would love your help merging this when you get a chance. It brings back v1's HyperdriveRef on v2

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.

no v2 equivalent of v1 HyperdriveRef

1 participant