Prisma Client

Intuitive database client for TypeScript and Node.js

The Prisma Client works seamlessly across languages and databases. Ship faster by writing less SQL. Avoid mistakes with a fully type-safe API tailored specifically for your app.

Prisma Client

Explore the
Prisma Client API

From simple reads to complex nested writes, the Prisma Client supports a wide range of operations to help you make the most of your data.

Get Started
  • Find Records
  • Traverse Relations
  • Order By, Limits & Cursors
  • Aggregates & Group By
1// Find all posts
2const allPosts: Post[] = await prisma.post.findMany()
1// Find a user by ID
2const userById: User | null = await prisma.user.findUnique({
3 where: {
4 id: 2,
5 },
6})
1// Find a user by email
2const userByEmail = await prisma.user.findUnique({
3 where: {
4 email: 'ada@prisma.io',
5 },
6})
1// Find the first user that contains Ada
2const userByName = await prisma.user.findFirst({
3 where: {
4 name: {
5 contains: 'Ada',
6 },
7 },
8})
1// Select specific fields
2const userName = await prisma.user.findUnique({
3 where: {
4 email: 'ada@prisma.io',
5 },
6 select: {
7 name: true,
8 email: true,
9 },
10})

Editor integration

Autocomplete your way to Success

The best code is the code that writes itself. Prisma Client gives you a fantastic autocomplete experience so you can move quickly and be sure you don't write an invalid query. Our obsession with type safety means you can rest assured that your code works as expected, every time.

Get started in 5 minutes

Typedsql

Fully type-safe raw SQL

Execute SQL queries directly against your database without losing the benefits of Prisma’s type-checking and auto-completion. TypedSQL leverages the capabilities of Prisma Client to write raw SQL queries that are type-checked at compile time.

Learn more about TypedSQL

Works with your favourite databases and frameworks

Supported Databases
Selected Frameworks

Easy to integrate into your framework of choice, Prisma simplifies database access, saves repetitive CRUD boilerplate and increases type safety.

Prisma studio

Visual database browser

Prisma Studio is the easiest way to explore and manipulate data in your Prisma projects. Understand your data by browsing across tables, filter, paginate, traverse relations and edit your data with safety.

Learn more about Prisma Studio

Prisma migrate

Hassle-free migrations

Prisma Migrate auto-generates SQL migrations from your Prisma schema. These migration files are fully customizable, giving you full control and ultimate flexibility — from local development to production environments.

Explore Prisma Migrate