Skip to content

(WIP, DO NOT REVIEW) hyperdrive#31837

Draft
vy-ton wants to merge 1 commit into
productionfrom
dynamic-hyperdrive
Draft

(WIP, DO NOT REVIEW) hyperdrive#31837
vy-ton wants to merge 1 commit into
productionfrom
dynamic-hyperdrive

Conversation

@vy-ton

@vy-ton vy-ton commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@github-actions github-actions Bot added product:hyperdrive Hyperdrive: https://developers.cloudflare.com/hyperdrive/ size/m labels Jul 1, 2026
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
/src/content/docs/hyperdrive/ @elithrar, @rita3ko, @irvinebroque, @vy-ton, @ivoryibu, @thomasgauvin, @sejoker, @oxyjun, @knickish, @cloudflare/product-owners

@ask-bonk ask-bonk Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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):

  1. Unresolved TODO in published content (line ~35)
    The page contains TODO: replace with svg. This should be resolved before merging — either replace the ASCII diagram with an actual SVG or remove the placeholder text.

  2. Duplicate label in ASCII diagram (line ~32)
    The diagram lists Dynamic Worker A twice (A | B | A). The third worker should likely be Dynamic Worker C.

  3. env is undefined in connect() methods (lines ~65 and ~192)
    In both loader-worker.ts and outbound-interceptor.ts, the OutboundInterceptor.connect() method references env.CUSTOMER_HYPERDRIVE, but env is not in the method signature. Inside a WorkerEntrypoint, it should be this.env.CUSTOMER_HYPERDRIVE.

  4. Incorrect host comparison (line ~188)
    The interceptor compares host (a hostname string, e.g. db.example.com:5432) against this.ctx.props.tenant.connectionString (a full connection string like postgresql://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.

  5. Placeholder $today in compatibilityDate (line ~85)
    The example uses compatibilityDate: "$today". This should be a real compatibility date (e.g. "2024-01-15") or replaced with a documented placeholder convention.

Non-blocking suggestions:

  1. Hyperdrive binding lacks id (line ~148)
    The Wrangler config shows a Hyperdrive binding with only binding and no id. Standard Hyperdrive bindings require an id. If Dynamic Hyperdrive uses a special binding format, consider adding a note explaining why id is omitted.

  2. 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.

  3. PR title indicates WIP
    The title (WIP, DO NOT REVIEW) hyperdrive signals this is not ready. If it is ready for review, update the title; if not, the do-not-merge-yet label is appropriate.

@ask-bonk

ask-bonk Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Review posted to PR #31837 with CHANGES_REQUESTED status, and the do-not-merge-yet label has been added.

What changed

The PR introduces a new concept page at src/content/docs/hyperdrive/concepts/dynamic-hyperdrive.mdx (+264 lines) that documents how to use Hyperdrive with Dynamic Workers for per-tenant database connection pooling and caching.

Key issues flagged

Issue Severity Notes
TODO: replace with svg in content Blocking Should not merge with unresolved TODOs
Duplicate Dynamic Worker A in diagram Blocking Third worker should be C
env undefined in connect() Blocking Should be this.env.CUSTOMER_HYPERDRIVE in both code examples
host === connectionString comparison Blocking A hostname will never equal a full connection string; logic will fail at runtime
$today placeholder Blocking Should be a real compatibility date
Missing id in Hyperdrive binding Suggestion Verify if Dynamic Hyperdrive bindings intentionally omit id
Empty PR body Suggestion Add a description and any related tickets
WIP title Info Left do-not-merge-yet label since author signaled it is not ready

I did not push any commits or open new PRs.

github run

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge-yet product:hyperdrive Hyperdrive: https://developers.cloudflare.com/hyperdrive/ size/m

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants