| 1 | import * as Cloudflare from "@/Cloudflare"; |
| 2 | import * as Alchemy from "@/index.ts"; |
| 3 | import * as Prisma from "@/Prisma"; |
| 4 | import * as Effect from "effect/Effect"; |
| 5 | import * as Layer from "effect/Layer"; |
| 6 | import PrismaHostContainerWorker from "./worker.ts"; |
| 7 | |
| 8 | /** |
| 9 | * Dev-only stack for the #1334 Prisma-from-container path: a local |
| 10 | * `@prisma/dev` database handed to an arbitrary image as `DATABASE_URL`. |
| 11 | */ |
| 12 | export const state = Alchemy.inMemoryState(); |
| 13 | |
| 14 | export default Alchemy.Stack( |
| 15 | "PrismaHostContainerStack", |
| 16 | { |
| 17 | providers: Layer.merge(Cloudflare.providers(), Prisma.providers()), |
| 18 | state, |
| 19 | }, |
| 20 | Effect.gen(function* () { |
| 21 | const worker = yield* PrismaHostContainerWorker; |
| 22 | return { url: worker.url.as<string>() }; |
| 23 | }), |
| 24 | ); |