Databases made easy

Next-generation
Node.js and TypeScript
ORM

Prisma helps app developers build faster and
make fewer errors with an open source ORM for PostgreSQL, MySQL and SQLite.

npm install prisma -D
Try Prisma in 5 minutes
Code Editor
1
2
// Creating a new record
Database
idfirstNameemailactive

1Patrickpatrick@prisma.iotrue
2Edeneden@prisma.iotrue
3Dylandylan@prisma.iofalse
4Ankianki@prisma.iotrue
5Juracijuraci@prisma.iofalse
Supported Languages
Prisma Schema

Data model
you can read

Central to Prisma is the schema - a declarative way to define your app's data models and their relations that's human-readable. And you don't have to painstakingly create it from scratch if you already have a database - prisma introspect takes care of that.

schema.prisma
1datasource db {
2 provider = "sqlite"
3 url = env("DATABASE_URL")
4}
5
6generator client {
7 provider = "prisma-client-js"
8}
9
10model Post {
11 id Int @id @default(autoincrement())
12 title String
13 content String?
14 published Boolean @default(false)
15 author User? @relation(fields: [authorId], references: [id])
16 authorId Int?
17}
Check out an example schema
Trusted in production by
index.tsx
1await prisma.user
2 .findUnique({
3 where: { email: 'ada@prisma.io' }
4 })
5 .posts({
6 where: {
7 title: {
8
9 }
10 }
11 })
 
contains
endsWith
equals
gt
gte
Prisma Client

Type-safe
database client

Prisma Client is a query builder that composes the way you think and gets auto-generated from the Prisma schema with types tailored to your app. We designed the API to be intuitive for both SQL veterans and people brand new to databases.

Icon for Visual Studio Code application

Extra ergonomy in Visual Studio Code

Auto-completion, linting, formatting and more help Prisma developers in VSCode stay confident without distractions.

Download the Prisma VSCode Extension
Typescript language logo

Make fewer errors with TypeScript

Prisma Client puts extra emphasis on extensive type safety for more productive development in TypeScript.

Type definitions in Prisma Client
Auto-generated
Seamless Relation API
Advanced Pagination
Declarative Nested Writes
Raw Database Access
Sorting and Filtering
Transaction API
Aggregation API
Case-insensitive Mode
Select Distinct
Helpful Error Messages
SQL Query Logging
JSON Field Support
Native Database Types
Middleware Support
Custom Generators
Explore the Prisma Client Documentation
diagram showing model schema evolution
Prisma Migrate

Hassle-free migrations

Based on the Prisma Schema, Prisma Migrate automatically generates SQL database migrations, that are fully customizable. For quick data model prototyping in development,prisma db push lets you make changes to the database without generating migration files.

Learn more
$ npx prisma migrate
Interface sketch and icon of Prisma studio
Prisma Studio

Visual database browser

The easiest way to explore and manipulate Data in your Prisma projects. Understand your data by browsing across tables and their relations and edit them with safety. Available for macOS, Windows and Linux.

Download
$ npx prisma studio

How does Prisma fit into your stack?

Prisma is a server-side library that helps your app read and write data to the database in an intuitive and safe way.

Diagram of Prisma in the Server part of Client - Server - Database stack
From development to production

Prisma in your application lifecycle

application lifecycle

Plan

Model your data in the Prisma schema with ease and in a human-readable format.

Code

Query your data in an intuitive and type-safe way with Prisma Client.

Test

Follow our guides for best practices on unit and integration tests with Prisma.

Deploy

Prisma works with all deployment paradigms, from traditional servers to containers, to serverless.

Monitor

Learn how to monitor and spot performance bottlenecks in your database queries.

Operate

Troubleshoot issues with your database when your application is running in production.

Engage with Prisma Developers

Join the thriving Prisma community

Prisma on Youtube - Livestreams, Events, Tutorials and Talks

Prisma’s YouTube channel is the headquarters for new weekly videos, livestreams, and meetups with Prisma folks and audience members.

Slack logo

Join 40,802 fans on Slack

Engage with a vibrant community of developers and companies adopting Prisma

GitHub logo

GitHub

Browse the Prisma source code, send feedback or join the discussion on GitHub.