1import { Connection } from "@/Prisma/Connection.ts";
2import { Postgres } from "@/Prisma/Postgres.ts";
3import { Project } from "@/Prisma/Project.ts";
4import { Stage } from "@/Stage.ts";
5import * as Effect from "effect/Effect";
6
7/**
8 * Local Prisma Postgres used as the container's DATABASE_URL origin — the
9 * #1334 demo shape (arbitrary image + connection.directConnectionString).
10 */
11export const PrismaHostConnection = Effect.gen(function* () {
12 const project = yield* Project("PrismaHostProject", {
13 createDatabase: false,
14 });
15 const database = yield* Postgres("PrismaHostDb", {
16 project,
17 name: "main",
18 dev: {
19 name: `alchemy-container-prisma-host-${yield* Stage}`,
20 persistenceMode: "stateless",
21 },
22 });
23 return yield* Connection("PrismaHostConnection", { database });
24});