t3-code-android-nightly/.repos/alchemy-effect/packages/alchemy/test/Cloudflare/Hyperdrive/fixtures/connection.ts
Julius Marminge 108e01746c
Upgrade Effect and Alchemy betas (#4643)
Prepare Relay production infrastructure for the PlanetScale PS_20 HA topology, upgrade Effect and Alchemy to compatible betas, reconcile migration state, and preserve patched MCP session termination behavior.\n\nCo-authored-by: codex <codex@users.noreply.github.com>
2026-07-27 16:21:02 +02:00

22 lines
850 B
TypeScript

import * as Cloudflare from "@/Cloudflare/index.ts";
import * as Neon from "@/Neon/index.ts";
import * as Effect from "effect/Effect";
/**
* Shared Neon Postgres origin + Hyperdrive Connection bound by both
* binding-test workers (effect-worker via `Cloudflare.Hyperdrive.Connect`
* and async-worker via `env: { HD: Connection }`). Because both workers
* bind this same Connection, the metadata they read back over `fetch`
* (host / port / user / database / connection string) must agree with the
* Neon origin that fronts it.
*/
export const HyperdriveConnection = Effect.gen(function* () {
const project = yield* Neon.Project("HyperdriveBindingProject");
const connection = yield* Cloudflare.Hyperdrive.Connection(
"HyperdriveBindingConnection",
{
origin: project.origin,
},
);
return { project, connection };
});