Skip to content

ci(workerd): Hyperdrive in front of Supabase on the edge - #158

Merged
okomarov merged 1 commit into
mainfrom
edge-supabase
Oct 19, 2026
Merged

okomarov merged 1 commit into
mainfrom
edge-supabase

Conversation

@okomarov

@okomarov okomarov commented Oct 19, 2026 •

Copy link
Copy Markdown

Stacked on #157.

Adds a Hyperdrive config in front of a free Supabase project's direct connection (postgresjs-ci, eu-west-1). It uses verify-full against Supabase's root CA, uploaded to Cloudflare as supabase-root-2021. The host is IPv6-only on the Free plan, and Hyperdrive reaches it. The config connects as a dedicated postgresjs_ci role with its own schema. The password exists only inside the Hyperdrive config, so the workflow needs no new secret.

Edge runs now make one Hyperdrive round by default, about 1,200 queries per push against the Free plan's 100,000 a day. hyperdrive_rounds on workflow_dispatch runs more.

Hyperdrive in front of Supavisor's transaction pooler (6543) failed every round on both builds and both dates with prepare: true (run 39234865111): prepared statement does not exist (26000), CONNECTION_CLOSED and timeouts. Both vendors' docs already rule this setup out:

That setup stays out of CI, and docs/api.md says so with links. This is the evidence for #154 (porsager#960).

A prepare: false run (39236978516) also failed. During that run, the CI role's connection limit (20, since raised to 40) was refusing connections (53300 too many connections in Supavisor's logs), so that run is not evidence either way.

…gainst Supabase on the edge

The edge runner retried a Cloudflare error page once. On the Workers
Free plan Cloudflare throttled every request to the Preview for about 95
seconds after repeated exceededCpu outcomes (run 39229088257), serving
its own HTTP 500 page. The runner now waits Retry-After when Cloudflare
sends one, otherwise 2 s doubling to 30 s, for up to 180 s per scenario,
and reports platformErrors and waitedMs.

The two edge jobs share one Neon database and run at the same time; one
dropped and recreated the subscribe publication between the other's drop
and create (42710, run 39232289023). The scenario now creates it once.

A Hyperdrive config in front of a free Supabase project's direct
connection, verify-full against Supabase's root CA uploaded to
Cloudflare. The host is IPv6-only on the Free plan and Hyperdrive reaches
it. It connects as a dedicated postgresjs_ci role confined to its own
schema; the password lives only in the Hyperdrive config, so the
workflow needs no new secret. The docs name Supabase as a private-CA
server that Workers reach through Hyperdrive.

Hyperdrive in front of Supavisor's transaction pooler failed every
round on both builds and dates with prepare: true: prepared statement
does not exist (26000), CONNECTION_CLOSED and timeouts (run
39234865111). Supavisor's transaction mode does not support prepared
statements (Supabase's connection docs), and Cloudflare's Supabase guide
points Hyperdrive at the direct connection while its postgres.js page
discourages prepare: false. That setup stays out of CI and the docs say
so, citing both (#154, porsager#960).

With three configs, five rounds cost about 6,000 queries per push
against the Free plan's 100,000 a day, so PR and main runs make one
round; longer runs stay on workflow_dispatch with hyperdrive_rounds.
@okomarov
okomarov changed the base branch from edge-backoff to main October 19, 2026 13:17
@okomarov
okomarov merged commit 063909d into main Oct 19, 2026
37 of 39 checks passed
@okomarov
okomarov deleted the edge-supabase branch October 19, 2026 13:18
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.

1 participant