PRISMA::DOCS
โŒ‚
Next-Generation ORM

Prisma Complete Guide

Prisma is a type-safe ORM for Node.js and TypeScript that replaces raw SQL and hand-written query builders with a single declarative schema file. You describe your tables as model blocks once, run one command, and Prisma generates a fully type-safe query client tailored exactly to that schema โ€” autocomplete for every field and relation, compile-time errors when a query is wrong, and no raw SQL required for the vast majority of everyday queries. This doc walks through the 8 things you actually need to learn to use Prisma confidently in a real project: setup, the schema file, migrations, querying, relations, filtering/sorting/pagination, transactions, and the developer tools that make local development pleasant.

8 topics 10 diagrams 1 schema file 0 raw SQL required

Use the sidebar to jump straight to any topic โ€” each one opens its own page with a full explanation, a diagram of how it fits into the rest of the workflow, and concrete steps (with real schema/query snippets) to actually use it. If you're starting from zero, work through the topics in order: nothing else makes sense until Introduction & Setup and the Schema File are in place.

Diagram ยท From Schema to Query โ€” The Prisma Pipeline
schema.prisma models + datasource prisma generate CLI command Prisma Client type-safe, autocompleted Your App Code imports the client Database Postgres/MySQLโ€ฆ

Everything starts from one file. schema.prisma describes your models; prisma generate turns that description into a fully typed client; your application code imports that client instead of writing SQL by hand; and the client itself is what actually talks to the underlying database.

All 8 topics in this guide

Summary & Recommended Order

Once each topic makes sense on its own, this page ties them together: the order to learn them in, and the single idea worth internalizing above all others โ€” that Prisma pushes correctness checks from runtime to compile time.

Recommended Learning Order

Prisma's Type-Safety Pipeline

The single most useful thing to understand about Prisma: mistakes that would normally surface as a runtime SQL error instead show up as a red squiggly line in your editor, before the code ever runs.

Diagram ยท Schema โ†’ Generated Types โ†’ Compile-Time Safety
schema.prisma model User { โ€ฆ } generate Generated Types User, Prisma.UserWhereInputโ€ฆ TS Compiler checks every query call Red squiggly in editor Runtime query actually runs

A typo'd field name, a wrong relation, or a filter on a column that doesn't exist gets caught by the compiler, not by a failed query in production โ€” the mistake never makes it past the top branch to the bottom one.

Official Documentation Reference URLs

Every topic covered in this guide, with a direct link to its official Prisma docs page.