1import * as Cloudflare from "@/Cloudflare";
2import * as Alchemy from "@/index.ts";
3import * as Prisma from "@/Prisma";
4import * as Effect from "effect/Effect";
5import * as Layer from "effect/Layer";
6import 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 */
12export const state = Alchemy.inMemoryState();
13
14export 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);