Skip to main content
Prisma Documentation Docs
current

Search documentation

Type to search this documentation.

Guides

Every guide in Prisma Documentation Docs.

Start

Prisma ORM

Prisma Postgres

Prisma Postgres

Build

Deploy

Manage

Reference

Guides

Upgrade Prisma ORM

Getting Started

Prisma ORM

Prisma Postgres

Introduction

Data Modeling

Contract Authoring

Fundamentals

Migrations

Middleware

Extensions

Database

Tools & Integrations

Infrastructure as Code

More

Tools

Prompts

Tutorials

Reference

Introduction

Migrating off Accelerate

Features

Reference

More

Introduction

Concepts

Workflows

Reference

Introduction

Features

Integrations

More

Introduction

Standalone commands

Migrate commands

Dev commands

DB commands

Console commands

Platform

ORM

Migration

Utility

Local Development

Guides

Next.jsAstroNuxtSvelteKitSolidStartReact RouterTanStack StartNestJSHonoElysiaBunDenoCloudflare WorkersDockerTurborepopnpm workspacesBun workspacesClerk (with Next.js)Clerk (with Astro)Better Auth (with Next.js)Better Auth (with Astro)Auth.js (with Next.js)AI SDK (with Next.js)Embedded Prisma Studio (with Next.js)Embed Prisma Studio in a Next.js application with @prisma/studio-core so you can browse and edit your database from inside your app.GitHub ActionsVercel app deploymentPrisma Postgres on DenoDatadogpgfencePermit.ioPlasmicShopifyVercelNetlifyLearn how to create Prisma Postgres databases via the official Netlify extension and deploy your applications with it.Fly.ioFirebase StudioViewing dataMultiple databasesExpand-and-contract migrationsSchema management in teamsLearn how a team collaborates on Prisma ORM migrations: what to commit, how to pull and apply teammates' changes, and how to resolve two branches that planned migrations from the same starting point.DrizzleSQL ORMsAdd Prisma ORM to an existing Sequelize or TypeORM project: infer a contract from the live database, sign it, and replace queries one at a time.MongooseMigrate from SupabaseExport application data from Supabase, restore it into Prisma Postgres, and reconnect your application.Migrate from NeonExport a selected Neon database, restore it into Prisma Postgres, and reconnect your application.Upgrade to v7Guide on how to upgrade to Prisma ORM 7Upgrade to v6Guides on how to upgrade to Prisma ORM 6Upgrade to v5Guides on how to upgrade to Prisma ORM 5Upgrade to v4Upgrade to v3Upgrade to v1Writing guides

Introduction

Core Concepts

Prisma Schema

Prisma Client

Prisma ClientIntroduction to Prisma ClientGenerating Prisma ClientCustom model and field namesRead replicasDatabase polyfillsConfiguring error formattingDatabase connectionsConnection poolPrisma ORM's query engine creates a connection pool to store and manage database connections. Applies to Prisma ORM v7.Connection managementThis 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 PgBouncerConfigure 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.CRUDSelect fieldsExcluding fieldsRelation queriesFiltering and sortingPaginationAggregation, grouping, and summarizingUse Prisma Client to aggregate, group by, count, and select distinct. Applies to Prisma ORM v7.Transactions and batch queriesFull-text searchQuery optimizationWhat are Client ExtensionsExtend the functionality of Prisma Client. Applies to Prisma ORM v7.Add methods to Prisma ClientAdd custom methods to your modelsCreate custom Prisma Client queriesAdd custom fields and methods to query resultsType utilitiesShared Prisma Client extensionsFine-Grained Authorization (Permit)Shared packages & examplesDeploy Prisma ORMDeploying database changes with Prisma MigrateDeploy migrations from a local environmentCaveats when deploying to AWS platformsDeploy to VercelDeploy to AWS LambdaLearn 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 FunctionsDeploy to NetlifyLearn how to deploy Node.js and TypeScript applications that are using Prisma Client to Netlify. Applies to Prisma ORM v7.Deploying edge functions with Prisma ORMLearn 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 & MiddlewareLearn 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 & PagesLearn 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 DeployDeploy to HerokuDeploy to RailwayDeploy to Fly.ioDeploy to KoyebDeploy to RenderLearn how to deploy a Node.js server that uses Prisma ORM to Render. Applies to Prisma ORM v7.Deploy to SevallaLoggingOpenTelemetry tracingDiagnose application performance with detailed traces of each query. Applies to Prisma ORM v7.SQL commentsDebuggingHandling exceptions and errorsFields & typesWorking with Json fieldsWorking with scalar listsWorking with compound IDs and unique constraintsComposite typesNull and undefinedUnit testingIntegration testingLearn how to setup and run integration tests with Prisma and Docker. Applies to Prisma ORM v7.Type safety OverviewHow to use Prisma ORM's type systemOperating against partial structures of your model typesWrite your own SQLRaw queriesTypedSQLLearn 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

Prisma Migrate

Reference

More

Introduction

Authentication & Tools

Endpoints

Delete databaseREST API: Deletes the database with the given ID.Get databaseREST API: Returns the database with the given ID.List databasesREST API: Returns all databases the token has access to. Optionally filter by project ID.Get list of databasesREST API: Returns databases for the given project.Update databaseREST API: Updates the database with the given ID. `logicalId` cannot be combined with `branchId` or `branchGitName` in one request; move the database first, then set its `logicalId`.Restore database (destructive)REST API: **Destructive operation** — this immediately and irreversibly overwrites all data in the target database with the contents of the specified backup. Any data written since the backup was taken will be lost. Ensure you have a recent backup of the target database before proceeding. Replaces the data in an existing database from a backup. Connections and credentials are preserved — only the data layer is replaced.Create databaseREST API: Creates a new database in the specified project. `logicalId` cannot be combined with `branchGitName`; pass `branchId` instead.Create databaseREST API: Creates a new database for the given project.Get list of backupsREST API: Returns backups for the specified database.Get database usage metricsREST API: Returns usage metrics for the specified database.Get list of database connectionsREST API: Returns all connections for the given database.Create database connection stringREST API: Creates a new connection string for the given database.Delete integrationREST API: Revokes the integration tokens by integration ID.Revoke integration tokensREST API: Revokes the integration tokens with the given client ID.Get integration by IDREST API: Returns a single integration by its ID.Get list of integrationsREST API: Returns integrations filtered by workspace ID.Get list of integrationsREST API: Returns integrations for the given workspace.Delete projectREST API: Deletes the project with the given ID.Get projectREST API: Returns the project with the given ID.Get list of projectsREST API: Returns the list of projects the token has access to.Update projectREST API: Updates the project with the given ID.Transfer projectREST API: Transfer the project with the given ID to the new owner's workspaceCreate project with a postgres databaseREST API: Creates a new project with a postgres database.Get workspace subscriptionREST API: Returns subscription information for the workspace with the given ID.Get workspaceREST API: Returns the workspace with the given ID.Get list of workspacesREST API: Returns the list of workspaces the current token can access.Delete connectionREST API: Deletes the connection with the given ID.Get connectionREST API: Returns the connection with the given ID.List connectionsREST API: Returns all connections the actor has access to, with optional database filter.Rotate connection credentialsREST API: Generates new credentials for the connection with the given ID. Revocation of the previous credentials is best-effort.Create connectionREST API: Creates a new connection for the specified database.Get all regionsREST API: Returns all available regions across products. Optionally filter by product.Get current authenticated principalREST API: Returns the user, workspace, and credential represented by the current token.Get Prisma Accelerate regionsREST API: Returns all available regions for Prisma Accelerate.Get Prisma Postgres regionsREST API: Returns all available regions for Prisma Postgres.Delete bucket keyREST API: Revokes and deletes the bucket key with the given ID.Delete bucketREST API: Permanently deletes the bucket with the given ID, all objects stored in it, and all its access keys. This action cannot be undone.List bucket keysREST API: Returns all access keys for the given bucket.Get bucketREST API: Returns the bucket with the given ID.List bucketsREST API: Returns all object-store buckets the token has access to. Optionally filter by project ID.Update bucketREST API: Updates the display name, logical id, or branch of the bucket with the given ID. The display name is a label only: the provider bucket name, the objects, and the access keys do not change. `logicalId` cannot be combined with `branchId` or `branchGitName` in one request; move the bucket first, then set its `logicalId`.Create bucket keyREST API: Creates a new access key for the given bucket. The `secretAccessKey` field is returned exactly once in this response and is never stored — copy it immediately.Create bucketREST API: Creates a new object-store bucket in the specified project.Delete service tokenREST API: Revokes the service token with the given ID by deleting it.List service tokensREST API: Returns the service tokens for the given workspace, newest first.Create service tokenREST API: Creates a new service token for the given workspace. The `value` field is returned exactly once in this response and is never stored — copy it immediately.Poll an approvalREST API: Reports where an approval stands, so an agent holding an approval_required response can wait for the sponsor's decision and retry. Only the agent the approval belongs to can read it.

Introduction

Integrations

Suggest an edit

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

Export
Documentation menu