(WIP, DO NOT REVIEW) hyperdrive#31837
Conversation
|
This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:
|
There was a problem hiding this comment.
PR Review: Dynamic Hyperdrive concept page
Summary
This PR adds a new concept page (src/content/docs/hyperdrive/concepts/dynamic-hyperdrive.mdx) that explains how to use Hyperdrive with Dynamic Workers for per-tenant database connections. It includes architecture explanation, TypeScript code examples for a loader Worker and an outbound interceptor, and a Wrangler configuration snippet.
Labels
- Already applied:
size/m,product:hyperdrive - Added:
do-not-merge-yet(PR title indicates WIP and there is an unresolved TODO in the content)
Issues flagged
Blocking issues (should be fixed before merge):
-
Unresolved TODO in published content (line ~35)
The page containsTODO: replace with svg. This should be resolved before merging — either replace the ASCII diagram with an actual SVG or remove the placeholder text. -
Duplicate label in ASCII diagram (line ~32)
The diagram listsDynamic Worker Atwice (A | B | A). The third worker should likely beDynamic Worker C. -
envis undefined inconnect()methods (lines ~65 and ~192)
In bothloader-worker.tsandoutbound-interceptor.ts, theOutboundInterceptor.connect()method referencesenv.CUSTOMER_HYPERDRIVE, butenvis not in the method signature. Inside aWorkerEntrypoint, it should bethis.env.CUSTOMER_HYPERDRIVE. -
Incorrect
hostcomparison (line ~188)
The interceptor compareshost(a hostname string, e.g.db.example.com:5432) againstthis.ctx.props.tenant.connectionString(a full connection string likepostgresql://user:pass@db.example.com:5432/dbname). This condition will almost always fail. Consider parsing the connection string to extract the host, or storing the host separately in the tenant config. -
Placeholder
$todayincompatibilityDate(line ~85)
The example usescompatibilityDate: "$today". This should be a real compatibility date (e.g."2024-01-15") or replaced with a documented placeholder convention.
Non-blocking suggestions:
-
Hyperdrive binding lacks
id(line ~148)
The Wrangler config shows a Hyperdrive binding with onlybindingand noid. Standard Hyperdrive bindings require anid. If Dynamic Hyperdrive uses a special binding format, consider adding a note explaining whyidis omitted. -
PR body is empty
The PR has no description. Consider adding a brief summary of the change and linking to any related internal tickets or docs planning issues. -
PR title indicates WIP
The title(WIP, DO NOT REVIEW) hyperdrivesignals this is not ready. If it is ready for review, update the title; if not, thedo-not-merge-yetlabel is appropriate.
|
✅ Review posted to PR #31837 with What changedThe PR introduces a new concept page at Key issues flagged
I did not push any commits or open new PRs. |
|
Preview URL: https://d6fe83bd.preview.developers.cloudflare.com Files with changes (up to 15) |
No description provided.