Skip to main content
Prisma Documentation Docs

Search documentation

Type to search this documentation.

Prisma Client

Prisma Client

Learn what Prisma Client is, how to generate it, and where to go next for querying, relations, and transactions. Applies to Prisma ORM v7.

Introduction to Prisma Client

Learn how to set up Prisma Client. Applies to Prisma ORM v7.

Generating Prisma Client

Learn how prisma generate works, how to configure the generator output, and how to import the generated Prisma Client. Applies to Prisma ORM v7.

Read replicas

Learn how to set up and use read replicas with Prisma Client. Applies to Prisma ORM v7.

Database polyfills (Prisma ORM v7) (/docs/orm/v7/prisma-client/setup-and-configuration/database-polyfills)

Configuring error formatting (Prisma ORM v7) (/docs/orm/v7/prisma-client/setup-and-configuration/error-formatting)

Introduction to Prisma Client

Learn how to set up Prisma Client. Applies to Prisma ORM v6.

Generating Prisma Client

This page explains how to generate Prisma Client. It also provides additional context on the generated client, typical workflows and Node.js configuration. Applies to Prisma ORM v6.

Instantiating Prisma Client

How to create and use an instance of PrismaClient in your app. Applies to Prisma ORM v6.

Database connections (Prisma ORM v7) (/docs/orm/v7/prisma-client/setup-and-configuration/databases-connections)

Connection pool

Prisma ORM's query engine creates a connection pool to store and manage database connections. Applies to Prisma ORM v7.

Connection management

This page explains how database connections are handled with Prisma Client and how to manually connect and disconnect your database. Applies to Prisma ORM v7.

Configure Prisma Client with PgBouncer

Configure Prisma Client with PgBouncer and other poolers: when to use pgbouncer=true, required transaction mode, prepared statements, and Prisma Migrate workarounds. Applies to Prisma ORM v7.

Database connections

Databases connections. Applies to Prisma ORM v6.

Connection pool

Prisma ORM's query engine creates a connection pool to store and manage database connections. Applies to Prisma ORM v6.

Connection management

This page explains how database connections are handled with Prisma Client and how to manually connect and disconnect your database. Applies to Prisma ORM v6.

Configure Prisma Client with PgBouncer

Configure Prisma Client with PgBouncer and other poolers: when to use pgbouncer=true, required transaction mode, prepared statements, and Prisma Migrate workarounds. Applies to Prisma ORM v6.

Read replicas

Learn how to set up and use read replicas with Prisma Client. Applies to Prisma ORM v6.

Database polyfills (Prisma ORM v6) (/docs/orm/v6/prisma-client/setup-and-configuration/database-polyfills)

No Rust engine

Learn how to use Prisma ORM without Rust engines. Applies to Prisma ORM v6.

Configuring error formatting (Prisma ORM v6) (/docs/orm/v6/prisma-client/setup-and-configuration/error-formatting)

CRUD

How to perform CRUD with Prisma Client. Applies to Prisma ORM v7.

Select fields (Prisma ORM v7) (/docs/orm/v7/prisma-client/queries/select-fields)

Excluding fields (Prisma ORM v7) (/docs/orm/v7/prisma-client/queries/excluding-fields)

Relation queries (Prisma ORM v7) (/docs/orm/v7/prisma-client/queries/relation-queries)

Filtering and sorting (Prisma ORM v7) (/docs/orm/v7/prisma-client/queries/filtering-and-sorting)

Pagination (Prisma ORM v7) (/docs/orm/v7/prisma-client/queries/pagination)

Aggregation, grouping, and summarizing

Use Prisma Client to aggregate, group by, count, and select distinct. Applies to Prisma ORM v7.

Transactions and batch queries (Prisma ORM v7) (/docs/orm/v7/prisma-client/queries/transactions)

Full-text search

Learn how to use full-text search with Prisma Client for PostgreSQL and MySQL. Applies to Prisma ORM v7.

Query optimization (Prisma ORM v7) (/docs/orm/v7/prisma-client/queries/advanced/query-optimization-performance)

CRUD

How to perform CRUD with Prisma Client. Applies to Prisma ORM v6.

Select fields (Prisma ORM v6) (/docs/orm/v6/prisma-client/queries/select-fields)

Excluding fields

This page explains how to exclude sensitive fields from Prisma Client. Applies to Prisma ORM v6.

Relation queries (Prisma ORM v6) (/docs/orm/v6/prisma-client/queries/relation-queries)

Filtering and Sorting (Prisma ORM v6) (/docs/orm/v6/prisma-client/queries/filtering-and-sorting)

Pagination (Prisma ORM v6) (/docs/orm/v6/prisma-client/queries/pagination)

Aggregation, grouping, and summarizing

Use Prisma Client to aggregate, group by, count, and select distinct. Applies to Prisma ORM v6.

Computed fields

This page explains how to use client extensions to add computed fields to Prisma models. Applies to Prisma ORM v6.

Custom models

This page explains how to wrap Prisma Client in custom models. Applies to Prisma ORM v6.

Transactions and batch queries

This page explains the transactions API of Prisma Client. Applies to Prisma ORM v6.

Full-text search

This page explains how to search for text within a field. Applies to Prisma ORM v6.

Case sensitivity (Prisma ORM v6) (/docs/orm/v6/prisma-client/queries/case-sensitivity)

Custom validation

This page explains how to add custom validation to Prisma Client. Applies to Prisma ORM v6.

Query optimization (Prisma ORM v6) (/docs/orm/v6/prisma-client/queries/query-optimization-performance)

What are Client Extensions

Extend the functionality of Prisma Client. Applies to Prisma ORM v7.

Add methods to Prisma Client (Prisma ORM v7) (/docs/orm/v7/prisma-client/client-extensions/client)

Add custom methods to your models (Prisma ORM v7) (/docs/orm/v7/prisma-client/client-extensions/model)

Create custom Prisma Client queries

Extend the functionality of Prisma Client, query component. Applies to Prisma ORM v7.

Add custom fields and methods to query results (Prisma ORM v7) (/docs/orm/v7/prisma-client/client-extensions/result)

Type utilities (Prisma ORM v7) (/docs/orm/v7/prisma-client/client-extensions/type-utilities)

Extensions

Extend the functionality of Prisma Client. Applies to Prisma ORM v6.

client: Add methods to Prisma Client (Prisma ORM v6) (/docs/orm/v6/prisma-client/client-extensions/client)

model: Add custom methods to your models (Prisma ORM v6) (/docs/orm/v6/prisma-client/client-extensions/model)

`query`: Create custom Prisma Client queries

Extend the functionality of Prisma Client, query component. Applies to Prisma ORM v6.

Type utilities (Prisma ORM v6) (/docs/orm/v6/prisma-client/client-extensions/type-utilities)

Shared Prisma Client extensions

Share extensions or import shared extensions into your Prisma project. Applies to Prisma ORM v7.

Fine-Grained Authorization (Permit)

Learn how to implement RBAC, ABAC, and ReBAC authorization in your Prisma applications. Applies to Prisma ORM v7.

Shared Prisma Client extensions

Share extensions or import shared extensions into your Prisma project. Applies to Prisma ORM v6.

Fine-Grained Authorization (Permit)

Learn how to implement RBAC, ABAC, and ReBAC authorization in your Prisma applications. Applies to Prisma ORM v6.

Shared packages & examples (Prisma ORM v7) (/docs/orm/v7/prisma-client/client-extensions/extension-examples)

Shared packages & examples (Prisma ORM v6) (/docs/orm/v6/prisma-client/client-extensions/extension-examples)

Deploy Prisma ORM (Prisma ORM v7) (/docs/orm/v7/prisma-client/deployment/deploy-prisma)

Deploying database changes with Prisma Migrate

Learn how to deploy database changes with Prisma Migrate. Applies to Prisma ORM v7.

Deploy Prisma ORM (Prisma ORM v6) (/docs/orm/v6/prisma-client/deployment/deploy-prisma)

Deploying database changes with Prisma Migrate

Learn how to deploy database changes with Prisma Migrate. Applies to Prisma ORM v6.

Deploy to a different OS (Prisma ORM v6) (/docs/orm/v6/prisma-client/deployment/deploy-to-a-different-os)

Module bundlers (Prisma ORM v6) (/docs/orm/v6/prisma-client/deployment/module-bundlers)

Deploy to Vercel

Learn how to deploy a Next.js application based on Prisma Client to Vercel. Applies to Prisma ORM v7.

Deploy to AWS Lambda

Learn how to deploy your Prisma ORM-backed applications to AWS Lambda with AWS SAM, Serverless Framework, or SST. Applies to Prisma ORM v7.

Deploy to Azure Functions (Prisma ORM v7) (/docs/orm/v7/prisma-client/deployment/serverless/deploy-to-azure-functions)

Deploy to Netlify

Learn how to deploy Node.js and TypeScript applications that are using Prisma Client to Netlify. Applies to Prisma ORM v7.

Serverless functions (Prisma ORM v6) (/docs/orm/v6/prisma-client/deployment/serverless)

Deploy to Vercel

Learn how to deploy a Next.js application based on Prisma Client to Vercel. Applies to Prisma ORM v6.

Deploy to AWS Lambda

Learn how to deploy your Prisma ORM-backed applications to AWS Lambda with AWS SAM, Serverless Framework, or SST. Applies to Prisma ORM v6.

Deploy to Azure Functions (Prisma ORM v6) (/docs/orm/v6/prisma-client/deployment/serverless/deploy-to-azure-functions)

Deploy to Netlify

Learn how to deploy Node.js and TypeScript applications that are using Prisma Client to Netlify. Applies to Prisma ORM v6.

Deploying edge functions with Prisma ORM

Learn how to deploy your Prisma-backed apps to edge functions like Cloudflare Workers or Vercel Edge Functions. Applies to Prisma ORM v7.

Deploy to Vercel Edge Functions & Middleware

Learn the things you need to know in order to deploy an Edge function that uses Prisma Client for talking to a database. Applies to Prisma ORM v7.

Deploy to Cloudflare Workers & Pages

Learn the things you need to know in order to deploy an app that uses Prisma Client for talking to a database to a Cloudflare Worker or to Cloudflare Pages. Applies to Prisma ORM v7.

Deploy to Deno Deploy

Learn how to deploy a TypeScript application using Prisma ORM to Deno Deploy. Applies to Prisma ORM v7.

Edge functions (Prisma ORM v6) (/docs/orm/v6/prisma-client/deployment/edge)

Deploying edge functions with Prisma ORM

Learn how to deploy your Prisma-backed apps to edge functions like Cloudflare Workers or Vercel Edge Functions. Applies to Prisma ORM v6.

Deploy to Vercel Edge Functions & Middleware

Learn the things you need to know in order to deploy an Edge function that uses Prisma Client for talking to a database. Applies to Prisma ORM v6.

Deploy to Cloudflare Workers & Pages

Learn the things you need to know in order to deploy an app that uses Prisma Client for talking to a database to a Cloudflare Worker or to Cloudflare Pages. Applies to Prisma ORM v6.

Deploy to Deno Deploy

Learn how to deploy a TypeScript application using Prisma ORM to Deno Deploy. Applies to Prisma ORM v6.

Deploy to Heroku

Learn how to deploy a Node.js server that uses Prisma ORM to Heroku. Applies to Prisma ORM v7.

Deploy to Railway (Prisma ORM v7) (/docs/orm/v7/prisma-client/deployment/traditional/deploy-to-railway)

Deploy to Fly.io (Prisma ORM v7) (/docs/orm/v7/prisma-client/deployment/traditional/deploy-to-flyio)

Deploy to Koyeb

Learn how to deploy a Node.js server that uses Prisma ORM to Koyeb Serverless Platform. Applies to Prisma ORM v7.

Deploy to Render

Learn how to deploy a Node.js server that uses Prisma ORM to Render. Applies to Prisma ORM v7.

Deploy to Sevalla

Learn how to deploy a Node.js server that uses Prisma ORM to Sevalla. Applies to Prisma ORM v7.

Traditional servers (Prisma ORM v6) (/docs/orm/v6/prisma-client/deployment/traditional)

Deploy to Heroku (Prisma ORM v6) (/docs/orm/v6/prisma-client/deployment/traditional/deploy-to-heroku)

Deploy to Railway (Prisma ORM v6) (/docs/orm/v6/prisma-client/deployment/traditional/deploy-to-railway)

Deploy to Fly.io (Prisma ORM v6) (/docs/orm/v6/prisma-client/deployment/traditional/deploy-to-flyio)

Deploy to Koyeb (Prisma ORM v6) (/docs/orm/v6/prisma-client/deployment/traditional/deploy-to-koyeb)

Deploy to Render

Learn how to deploy a Node.js server that uses Prisma ORM to Render. Applies to Prisma ORM v6.

Deploy to Sevalla

Learn how to deploy a Node.js server that uses Prisma ORM to Sevalla. Applies to Prisma ORM v6.

Logging

Learn how to configure Prisma Client to log the raw SQL queries it sends to the database and other information. Applies to Prisma ORM v7.

OpenTelemetry tracing

Diagnose application performance with detailed traces of each query. Applies to Prisma ORM v7.

SQL comments

Add metadata to your SQL queries as comments for improved observability, debugging, and tracing. Applies to Prisma ORM v7.

Logging

Learn how to configure Prisma Client to log the raw SQL queries it sends to the database and other information. Applies to Prisma ORM v6.

Metrics

Diagnose application performance with insights into Prisma Client database activity. Applies to Prisma ORM v6.

OpenTelemetry tracing

Diagnose application performance with detailed traces of each query. Applies to Prisma ORM v6.

SQL comments

Add metadata to your SQL queries as comments for improved observability, debugging, and tracing. Applies to Prisma ORM v6.

Debugging (Prisma ORM v7) (/docs/orm/v7/prisma-client/debugging-and-troubleshooting/debugging)

Debugging (Prisma ORM v6) (/docs/orm/v6/prisma-client/debugging-and-troubleshooting/debugging)

Fields & types (Prisma ORM v7) (/docs/orm/v7/prisma-client/special-fields-and-types)

Working with Json fields

How to read, write, and filter by Json fields. Applies to Prisma ORM v7.

Working with scalar lists

How to read, write, and filter by scalar lists / arrays. Applies to Prisma ORM v7.

Composite types (Prisma ORM v7) (/docs/orm/v7/prisma-client/special-fields-and-types/composite-types)

Null and undefined (Prisma ORM v7) (/docs/orm/v7/prisma-client/special-fields-and-types/null-and-undefined)

Fields & types (Prisma ORM v6) (/docs/orm/v6/prisma-client/special-fields-and-types)

Working with Json fields

How to read, write, and filter by Json fields. Applies to Prisma ORM v6.

Working with scalar lists

How to read, write, and filter by scalar lists / arrays. Applies to Prisma ORM v6.

Composite types (Prisma ORM v6) (/docs/orm/v6/prisma-client/special-fields-and-types/composite-types)

Null and undefined (Prisma ORM v6) (/docs/orm/v6/prisma-client/special-fields-and-types/null-and-undefined)

Unit testing

Learn how to setup and run unit tests with Prisma Client. Applies to Prisma ORM v7.

Integration testing

Learn how to setup and run integration tests with Prisma and Docker. Applies to Prisma ORM v7.

Testing (Prisma ORM v6) (/docs/orm/v6/prisma-client/testing)

Unit testing

Learn how to setup and run unit tests with Prisma Client. Applies to Prisma ORM v6.

Integration testing

Learn how to setup and run integration tests with Prisma and Docker. Applies to Prisma ORM v6.

Type safety Overview

Prisma Client provides full type safety for queries, even for partial queries or included relations. This page explains how to leverage the generated types and utilities. Applies to Prisma ORM v7.

How to use Prisma ORM's type system

How to use Prisma ORM's type system. Applies to Prisma ORM v7.

Type safety

Prisma Client provides full type safety for queries, even for partial queries or included relations. This page explains how to leverage the generated types and utilities. Applies to Prisma ORM v6.

How to use Prisma ORM's type system

How to use Prisma ORM's type system. Applies to Prisma ORM v6.

Prisma validator (Prisma ORM v6) (/docs/orm/v6/prisma-client/type-safety/prisma-validator)

Write your own SQL (Prisma ORM v7) (/docs/orm/v7/prisma-client/using-raw-sql)

Raw queries (Prisma ORM v7) (/docs/orm/v7/prisma-client/using-raw-sql/raw-queries)

TypedSQL

Learn how to use TypedSQL to write fully type-safe SQL queries that are compatible with any SQL console and Prisma Client. Applies to Prisma ORM v7.

SafeQL & Prisma Client

Learn how to use SafeQL and Prisma Client extensions to work around features not natively supported by Prisma, such as PostGIS. Applies to Prisma ORM v7.

Write your own SQL (Prisma ORM v6) (/docs/orm/v6/prisma-client/using-raw-sql)

Raw queries (Prisma ORM v6) (/docs/orm/v6/prisma-client/using-raw-sql/raw-queries)

TypedSQL

Learn how to use TypedSQL to write fully type-safe SQL queries that are compatible with any SQL console and Prisma Client. Applies to Prisma ORM v6.

SafeQL & Prisma Client

Learn how to use SafeQL and Prisma Client extensions to work around features not natively supported by Prisma, such as PostGIS. Applies to Prisma ORM v6.

Suggest an edit

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

Export
Documentation menu