The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 07:15 UTC
| 1 | import * as Cloudflare from "@alchemy.run/cloudflare"; |
| 2 | import * as Neon from "@alchemy.run/neon"; |
| 3 | import * as Effect from "effect/Effect"; |
| 4 | |
| 5 | /** |
| 6 | * Shared Neon Postgres origin + Hyperdrive Connection bound by both |
| 7 | * binding-test workers (effect-worker via `Cloudflare.Hyperdrive.Connect` |
| 8 | * and async-worker via `env: { HD: Connection }`). Because both workers |
| 9 | * bind this same Connection, the metadata they read back over `fetch` |
| 10 | * (host / port / user / database / connection string) must agree with the |
| 11 | * Neon origin that fronts it. |
| 12 | */ |
| 13 | export const HyperdriveConnection = Effect.gen(function* () { |
| 14 | const project = yield* Neon.Project("HyperdriveBindingProject"); |
| 15 | const connection = yield* Cloudflare.Hyperdrive.Connection("HyperdriveBindingConnection", { |
| 16 | origin: project.origin, |
| 17 | }); |
| 18 | return { project, connection }; |
| 19 | }); |