Prisma ORM 8 is here.Read the docs

Get started with Prisma

Open in ChatGPT

Prisma ORM

Use Prisma ORM on its own, with your own PostgreSQL or MongoDB database. Pick where you're starting from; each guide links its MongoDB version.

Pick your framework

Each guide covers the same steps: scaffold, connect Prisma Postgres, run a query, deploy. SvelteKit and Deno stop at a local run for now.

Prisma ORM 7

Still fully supported, with Prisma Postgres and Compute. Prisma ORM 8 is the upgrade path.

New project
npx create-prisma@stable
5-min quickstart
Existing project
npx prisma@prev init
Setup paths

Other setups

Each path has a guide, and a prompt you can hand to your agent.

Add Prisma ORM to the app you already have, on its PostgreSQL database. With no database yet, the prompt creates a Prisma Postgres one.

Using MongoDB? Add Prisma ORM to a MongoDB app.

Agent prompt: Existing project
Add Prisma ORM to this existing project.

This flow is for PostgreSQL. If the project uses MongoDB, follow https://www.prisma.io/docs/prisma-orm/add-to-existing-project/mongodb.md instead; for other databases, stop and tell me.

1. Run `npx prisma@latest orm init --yes --target postgres --authoring psl` (the flags are required when the CLI cannot prompt). It writes `prisma.config.ts`, a starter contract and `db.ts` under `src/prisma/`, and installs dependencies. Then run `npx prisma skills sync` to install the Prisma ORM skills.
2. Set `DATABASE_URL` in `.env` to my database. If I did not give you one, create a Prisma Postgres database with `npx create-db@latest`, put its connection string in `.env`, and show me the claim URL it prints so I can keep the database (claiming needs a free Prisma account).
3. If the database already has tables, infer the contract from it: `npx prisma contract infer`, then `npx prisma contract emit`, then sign it with `npx prisma db sign`. If the database is empty, keep the starter contract and run `npx prisma db init`.
4. Write one query with the generated `db` client in an existing code path, run it, and show me the returned rows.

Follow https://www.prisma.io/docs/prisma-orm/add-to-existing-project/postgresql.md and the installed Prisma ORM skills.
PostgreSQL guide

Browse the docs

The full docs for each product, and the references you'll come back to.