1---
2title: Prisma
3description: Prisma Postgres and Prisma Compute — projects, databases, connections, and deployed apps as Stack resources, with a zero-config local database in dev.
4---
5
6Prisma's data platform gives you serverless Postgres and a managed
7app runtime. With alchemy you declare the project, its databases,
8the connections your apps use, and the Compute deployments that run
9them — all as resources in one Stack. In dev mode the same Stack
10runs against a local `@prisma/dev` Postgres with nothing to
11provision.
12
13New here? [Set up credentials](/prisma/setup), then follow the
14[four-part tutorial](/prisma/tutorial/part-1) to deploy a Project, an
15Effect-native API, Postgres, and a Vite frontend.
16
17## Resources
18
19A `Prisma.Project` is the top-level container. By default it creates
20a Prisma Postgres database in `us-east-1`:
21
22```typescript
23const project = yield* Prisma.Project("app", {
24 region: "us-east-1",
25});
26```
27
28Prisma injects that database's system-managed `DATABASE_URL` and
29`DATABASE_URL_POOLED` variables into Compute deployments
30automatically.
31
32When you need a database with an independent lifecycle and explicit
33connection outputs, declare it separately:
34
35```typescript
36const project = yield* Prisma.Project("app", { createDatabase: false });
37
38const postgres = yield* Prisma.Postgres("db", {
39 project,
40});
41
42const connection = yield* Prisma.Connection("api", {
43 database: postgres,
44});
45```
46
47Display names are optional for these resources — omit them and alchemy
48generates stable physical names from the Stack, logical ID, and stage.
49
50The connection exposes ready-to-use outputs — a conventional
51`databaseUrl`, direct and pooled connection strings, and parsed
52`origin` components for poolers like Hyperdrive. See
53[Connections](/prisma/data/connections).
54
55[Branches](/prisma/data/branches) group databases and apps under
56git-style names. A standalone `Prisma.Branch` has Prisma's `preview`
57role even when promoted to be the project's default branch.
58
59## Websites
60
61Use [`Prisma.Website`](/prisma/frontend/websites) for Vite, Astro
62(SSR or static), Next.js, Nuxt, SvelteKit, React Router, SolidStart,
63TanStack Start, Waku, Octane, Foldkit, Vocs, or any static build.
64The framework's Node-target output runs on Bun in Prisma Compute,
65uploaded as `tar.gz` — no Docker image or registry. Even static sites
66run a Compute static-file server.
67
68Omit `project` for a database-less project created only on live deploy.
69`alchemy dev` runs the native framework dev server without creating
70Prisma resources for the Website. Start with the
71[Vite guide](/prisma/frontend/vite) or [framework overview](/prisma/frontend/websites).
72
73## Compute
74
75`Prisma.Compute` builds, uploads, and promotes an application next
76to its database — either a framework app built from a directory, or
77an Effect-native app defined inline:
78
79```typescript
80const app = yield* Prisma.Compute("api", {
81 project,
82 path: "./app",
83 build: "auto",
84 healthCheck: { path: "/api/health" },
85});
86```
87
88For a standalone database, pass `connection.databaseUrl` explicitly
89as shown in [Connections](/prisma/data/connections).
90
91The candidate health check gates promotion. If the stable endpoint
92fails after promotion, alchemy attempts to restore the previous
93deployment and fails closed if recovery cannot converge. See
94[Deployments](/prisma/compute/deployments).
95
96## Runtime bindings
97
98Inside a Compute app, Lambda function, or Cloudflare Worker,
99`Prisma.Connect` turns a Connection into a typed runtime client
100whose `databaseUrl` feeds straight into
101[Prisma ORM v8](/sql/prisma/postgres), `SQL.Postgres`, or Drizzle:
102
103```typescript
104Effect.gen(function* () {
105 const db = yield* Prisma.Connect(connection);
106 const sql = yield* SQL.Postgres({ url: db.databaseUrl });
107
108 return {
109 fetch: Effect.gen(function* () {
110 const users = yield* sql`SELECT * FROM users`;
111 return yield* HttpServerResponse.json(users);
112 }),
113 };
114}).pipe(Effect.provide(Prisma.ConnectBinding));
115```
116
117## The Prisma path
118
119On Cloudflare, Prisma Postgres slots into the same path as the other
120Postgres providers:
121
1221. [Hyperdrive](/cloudflare/data/hyperdrive) pools the connection's
123 direct `origin` at the edge
1242. [Prisma ORM v8](/sql/prisma/postgres),
125 [Drizzle](/cloudflare/data/drizzle), or
126 [`SQL.Postgres`](/sql/effect-sql/postgres) gives the Worker a
127 typed query layer over that connection
1283. [Connect from Workers](/prisma/guides/cloudflare-workers) walks
129 through both wiring styles
130
131## Reference
132
133- [Project](/providers/prisma/project)
134- [Database](/providers/prisma/database)
135- [Connection](/providers/prisma/connection)
136- [Branch](/providers/prisma/branch)
137- [Compute](/providers/prisma/compute)
138- [SourceRepository](/providers/prisma/sourcerepository)