Cloud Parts

Prisma ORM

A TypeScript ORM driven by a schema file: you declare models once, Prisma generates a fully typed client and SQL migrations from them, and queries return plain JavaScript objects.

What it is
Object-relational mapping (full orms)
Type
Open source
Made by
Prisma
License
Apache 2.0
Facts checked
8 October 2026

What it is

Instead of mapping classes, you describe models in the Prisma schema language (schema.prisma): fields, relations and the database they live in. That file is the single source of truth for both the database schema and the types in your code. prisma migrate dev turns changes to it into SQL migration files, and prisma generate writes Prisma Client, a query API typed to your models: prisma.user.findMany({ include: { posts: true } }). Results are plain objects, not tracked model instances, so there is no session, identity map or lazy loading. Related records arrive only when a query asks for them with include or select; on PostgreSQL, CockroachDB and MySQL the join strategy (a preview feature in version 7) fetches them in a single query using a lateral join or correlated subqueries with JSON aggregation, while the query strategy sends one query per table. TypedSQL and the raw query methods cover SQL the API can’t express. Prisma describes itself as a new kind of ORM that implements the Data Mapper pattern.

Prisma ORM 7 (November 2025) is the current stable line. It replaced the Rust query engine with a TypeScript client that talks to the database through driver adapters such as @prisma/adapter-pg; Prisma reports 90% smaller bundles and 3× faster queries from the change. It supports PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB, plus hosted services such as Neon and PlanetScale. Prisma ORM 8, a ground-up TypeScript rewrite, is a release candidate with general availability expected in October 2026: a “contract” file replaces schema.prisma, each database gets its own library, and only PostgreSQL is a release candidate so far (MongoDB in early access, SQLite experimental, MySQL to follow). Prisma 7 will get fixes for 18 months after version 8 ships.

Why teams pick it

  • One schema file generates both migrations and a client whose results are fully typed, including nested relations
  • Plain objects and explicit include/select make every relation load visible; no lazy-loading surprises
  • Broad database support in version 7, including MongoDB, plus hosted options such as Neon, PlanetScale and Prisma’s own Postgres
  • Since version 7 a pure TypeScript client with driver adapters, which suits serverless and edge runtimes

Watch out for

  • Its own schema language and generated code: a build step to run, and a new syntax to learn
  • No unit of work or change tracking: updates are explicit calls, and complex domain models need their own layer on top
  • Complex reporting queries fall back to TypedSQL or raw SQL
  • A moving target in 2026: Prisma 8 changes the schema file, packages and CLI, and lacks some version 7 features such as $extends, atomic increments and most nested writes

Alternatives

What all full orms have in common →

How it fits with other technologies

Prisma ORM 7: a schema, then a typed query that loads users with their posts · ts

// prisma/schema.prisma
//   model User {
//     id    Int    @id @default(autoincrement())
//     email String @unique
//     posts Post[]
//   }
//   model Post {
//     id       Int    @id @default(autoincrement())
//     title    String
//     author   User   @relation(fields: [authorId], references: [id])
//     authorId Int
//   }
// then: npx prisma migrate dev --name init   (writes and applies the SQL migration)

import { PrismaPg } from "@prisma/adapter-pg";
import { PrismaClient } from "./generated/prisma/client";

const prisma = new PrismaClient({
  adapter: new PrismaPg({ connectionString: process.env.DATABASE_URL }),
});

// plain objects typed as { id; email; posts: { id; title; authorId }[] }[]
const users = await prisma.user.findMany({
  where: { email: { endsWith: "@example.com" } },
  include: { posts: true },
});
console.log(users[0]?.posts.length);

See it in a real stack

No architecture uses Prisma ORM yet. Drop it into the playground and wire it up yourself.Open playground →
Where it came from2018–2026

Prisma began as Graphcool, a Berlin startup co-founded by Johannes Schickling that ran an open-source GraphQL backend-as-a-service: database, application layer and API in one. After two years in production, users kept asking for more control, such as separating the database from the API and defining their own GraphQL schemas. The company split out Graphcool’s query engine as a standalone component, renamed it Prisma, and released “Prisma 1.0” under the Apache 2 license; in May 2018 it raised a $4.5 million seed round led by Kleiner Perkins.

Prisma 1 generated a CRUD GraphQL API for a database, which developers wrapped in their own servers. That proved hard to type fully and tied Prisma to GraphQL and JavaScript, so the team turned it into a generated, type-safe database client meant to replace traditional ORMs. Prisma 2.0 launched on 9 June 2020, pitched as an auto-generated, type-safe query builder for Node.js and TypeScript, tailored to your data.

Prisma Client had been built on a query engine written in Rust. After version 6 (November 2024), Prisma announced it would rebuild the client in TypeScript, citing slow communication between Rust and the JavaScript runtime and the barrier Rust put in front of contributors. Prisma ORM 7, released on 19 November 2025, made the TypeScript client the default. A year later Prisma ORM 8, another ground-up rewrite around a database “contract”, reached release candidate.

Why it’s built this way

A schema file instead of mapped classes
Prisma argues that mapping tables to model classes is what causes the object-relational impedance mismatch, so models live in one declarative schema that drives both the database and the generated types.
Generate the client
Generating code from the schema lets every query result, including nested relations, carry an exact TypeScript type, which Prisma 1’s GraphQL bindings could not do.
A Rust query engine, later removed
Rust promised speed, but crossing from JavaScript into Rust was slower than staying in JavaScript, added runtime dependencies and size limits on platforms like Cloudflare Workers, and kept out contributors without Rust experience. Prisma 7 rebuilt the client in TypeScript.
Plain objects, explicit relation loading
Returning plain JavaScript objects keeps queries predictable: nothing loads behind the developer’s back, so there is no lazy-loading N+1.

Timeline

  1. 2018

    Graphcool’s query engine is released as Prisma 1.0; $4.5M seed in May

  2. 2020

    Prisma 2.0 with the type-safe Prisma Client, 9 June

  3. 2024

    Prisma ORM 6.0 in November

  4. 2025

    Prisma ORM 7 with a Rust-free TypeScript client, 19 November

  5. 2026

    Prisma ORM 8, a ground-up rewrite, reaches release candidate

Sources10 · facts checked 8 October 2026

Improve this page on GitHub