Skip to main content
Prisma Documentation Docs

Search documentation

Type to search this documentation.

On this pageOverview

Prisma ORM

Prisma ORM 8 rewrites Prisma ORM in TypeScript. The schema-first workflow and model-first queries from earlier versions stay, but what changes is what your schema produces and how queries run. This page gives you the mental model, and the quickstart gets you to a running query.

You still author models in a Prisma schema file (or in TypeScript), but instead of generating a client package, Prisma ORM emits the schema as a contract: a JSON document plus TypeScript types that your application, the migration tools, and coding agents all read. The contract is a plain artifact you can inspect and diff.

The workflow has three steps:

  1. Author your schema: define your models in a Prisma schema (.prisma) or directly in TypeScript.
  2. Emit the contract: a lightweight build step turns the schema into a deterministic JSON contract plus TypeScript types.
  3. Query with a composable DSL: write queries inline against the typed contract. Each query compiles to a verifiable plan at runtime, with no hidden client methods.
  • Better queries: simpler nested queries, custom collection methods on your models, results you can iterate a record at a time, and a low-level type-safe SQL builder when you need raw control.
  • Extensible by design: a minimal core exposed through a public SPI. Everything around it, including Postgres support itself, is an extension, so you can add databases, query builders, data types, and middleware.
  • Rethought migrations: graph-based migrations that resolve branch conflicts automatically and make partial failures safe to retry, with both schema and data migrations written in TypeScript and validated against your contract.
  • AI-agent friendly: the contract is machine-readable and each query produces an inspectable plan, which gives coding agents something concrete to check their work against. The installers also register agent skills for your editor's AI assistant.

Prisma ORM ships first-class support for PostgreSQL (the primary target), MongoDB, and SQLite (@prisma/orm-sqlite). MySQL support is planned next.

Scaffold a new project in one command:

bun create prisma@latest
Bash
pnpm create prisma@latest
Bash
yarn create prisma@latest
Bash
npm create prisma@latest

Quickstart with PostgreSQL Scaffold a Prisma ORM app with PostgreSQL, seed it, and run your first query.Add to an existing project Add Prisma ORM to an existing app with the orm init command.The full stack path Prisma ORM with Prisma Postgres and a Prisma Compute deploy, with guide and agent options.

Learn the fundamentals Read, write, and relate data with the ORM, run transactions, and reach for advanced queries when you need them.The data contract Learn how your schema becomes a verifiable contract, authored in PSL or TypeScript.CLI reference The contract, database, and migration commands in the Prisma ORM CLI.See your migrations in Studio Read your applied migration history in Prisma Studio: a visual diff, the executed SQL, and a schema diff per migration.Deploy the application Deploy your Prisma ORM app to Prisma Compute, next to your Prisma Postgres database.

The thinking behind Prisma ORM is documented on the Prisma blog. Start with these:

The full series also covers TypeScript migrations, data migrations, the extension API, the roadmap, and the early-access launch. The source lives on GitHub.

Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu