Guides
Every guide in Prisma Documentation Docs.
Start
Prisma ORM
Introduction to Prisma ORMRelease statusSupported databasesI'm creating a new appI have an app, but no database yetI have a database alreadyI have a Prisma 7 appStep-by-step guide to migrating a Prisma ORM 7 PostgreSQL project to Prisma ORM 8 incrementally. Run both clients side by side, migrate routes one at a time, then move migrations to Prisma ORM 8.Editor setupHow the Prisma VS Code extension detects a Prisma ORM contract, what it checks and completes, and how to fix false errors after an upgrade.create-prisma
Prisma Postgres
Prisma Postgres
Build
ORMPrisma ORM is a typed data layer for TypeScript. You describe your data in a contract, and Prisma ORM gives you typed queries and migrations for PostgreSQL, MongoDB, and SQLite.ComposerPrisma Composer lets you declare services, their contracts, and their databases in TypeScript, then provisions and connects them on Prisma Compute and Prisma Postgres.Local DevelopmentDevelop against the Prisma stack locally. Run your app on Bun, start a local Prisma Postgres database with prisma dev, and use local stand-in buckets for object storage.
Deploy
ComputeLearn how Prisma Compute deploys TypeScript apps alongside Prisma Postgres, with isolated branch previews, database branches, and CLI-first workflows.PostgresPrisma Postgres is a managed PostgreSQL database with connection pooling and edge support. Connect from Prisma ORM, Kysely, Drizzle, or any PostgreSQL client.Storage
Manage
Reference
Guides
GuidesNext.jsAstroNuxtSvelteKitSolidStartReact Router 7TanStack StartNestJSHonoElysiaBunDenoCloudflare WorkersCloudflare D1DockerTurborepopnpm workspacesBun workspacesMultiple databasesLearn how to use multiple Prisma Clients in a single app to connect to multiple databases, handle migrations, and deploy your application to Vercel. Applies to Prisma ORM v7.Expand-and-contract migrationsSchema management in teamsLearn how to use Prisma Migrate effectively when collaborating on a project as a team. Applies to Prisma ORM v7.DrizzleLearn how to migrate from Drizzle to Prisma ORM. Applies to Prisma ORM v7.SQL ORMsMongooseAI SDK (with Next.js)GitHub ActionsNeon with AccelerateSupabase with Accelerate
Upgrade Prisma ORM
Getting Started
Prisma ORM
Prisma PostgresSQLitePostgreSQLMySQLSQL ServerPlanetScaleCreate a new TypeScript project from scratch by connecting Prisma ORM to PlanetScale MySQL and generating a Prisma Client for database access. Applies to Prisma ORM v7.CockroachDBMongoDBPrisma PostgresSQLitePostgreSQLMySQLSQL ServerPlanetScaleAdd Prisma ORM to an existing TypeScript project with PlanetScale MySQL and learn database introspection and querying. Applies to Prisma ORM v7.CockroachDBMongoDB
Prisma Postgres
Introduction
Data Modeling
Contract Authoring
The data contractWhat the Prisma ORM data contract is, how PSL and TypeScript authoring produce the same two files, and how the contract drives typing, migrations, and checking your database.Author in PSLLearn how to write a Prisma ORM contract in the Prisma schema language, including named types, enums, value objects, relations, and extension types.Author in TypeScriptHow to define a Prisma ORM contract in TypeScript with defineContract, including fields, relations, enums, storage mapping, and extension types.contract.json and contract.d.tsSupported database features
Fundamentals
Reading dataQuery PostgreSQL and MongoDB with Prisma ORM. Filter with where, project with select, sort with orderBy, paginate with limit and offset, and iterate large results one record at a time.Writing dataCreate, update, delete, and upsert records in PostgreSQL and MongoDB with Prisma ORM, and use createAll, updateAll, and deleteAll for bulk writes.Relations and joinsTransactionsAdvanced queries
Migrations
Middleware
How middleware worksWhat Prisma ORM middleware is, the hooks it gives you, how to register it on your client, and which middleware ships built in.Built-in: budgetsBuilt-in: lintsBuilt-in: cacheWire the Prisma ORM cache middleware, opt queries in with cacheAnnotation and a TTL, and understand cache keys, scopes, and hits.Authoring custom middleware
Extensions
Database
DatabaseConnecting to your databaseConnect to Prisma Postgres without AccelerateReplace a hosted Prisma Postgres Accelerate connection with pooled TCP or the Prisma Postgres serverless driver.Connection poolingQuery InsightsBackupsExtensionsLearn about Postgres extensions with Prisma PostgresServerless driverA lightweight PostgreSQL driver for Prisma Postgres optimized for serverless and edge environments with HTTP/WebSocket support, result streaming, and minimal memory footprint.
Tools & Integrations
Infrastructure as Code
More
Tools
Prompts
Tutorials
Reference
Prisma ORM API referenceThis page gives an overview of all available Prisma CLI commands, explains their options and shows numerous usage examples. Applies to Prisma ORM v7.ORM client referenceReference for the Prisma ORM client's query, mutation, filter, and aggregate methods.SQL query builder referenceReference for the Prisma ORM SQL query builder's select, mutation, and grouped query methods.Pipeline builder referenceReference for the Prisma ORM MongoDB pipeline builder's stages, accumulators, expression helpers, and write methods.Raw queries referenceTransactions and runtime referenceMigration APIError referenceMCP tools
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
Overview of Prisma SchemaData sourcesGeneratorsSchema locationModelsLearn about the concepts for building your data model with Prisma: Models, scalar types, enums, attributes, functions, IDs, default values and more. Applies to Prisma ORM v7.RelationsOne-to-one relationsOne-to-many relationsMany-to-many relationsSelf-relationsReferential actionsCircular references or multiple cascade paths can cause validation errors on Microsoft SQL Server and MongoDB. Since the database does not handle these situations out of the box, learn how to solve this problem. Applies to Prisma ORM v7.Relation modeManage relations between records with relation modes in Prisma. Applies to Prisma ORM v7.Troubleshooting relationsDatabase mappingIndexesViewsMulti-schemaExternal tablesTable inheritanceUnsupported database features (Prisma Schema)What is introspection?PostgreSQL extensions
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
Overview of Prisma MigrateGetting started with Prisma MigrateUnderstanding MigrationsA mental model guide for working with Prisma Migrate in your project. Applies to Prisma ORM v7.Migration historiesAbout the shadow databaseLimitations and known issuesPrototyping your schemaDevelopment and productionBaselining a databaseCustomizing migrationsHow to edit a migration file before applying it to avoid data loss in production. Applies to Prisma ORM v7.Generating down migrationsSquashing migrationsPatching & hotfixingSeedingNative database typesNative database functionsUnsupported database features (Prisma Migrate)Troubleshooting
Reference
Prisma CLI referencePrisma Client APIAPI reference documentation for Prisma Client. Applies to Prisma ORM v7.Schema APIConfig APIThis page gives an overview of all Prisma config options available for use. Applies to Prisma ORM v7.Connection URLsEnvironment VariablesDatabase FeaturesSupported databasesSystem requirementsSystem requirements for running Prisma ORM. Applies to Prisma ORM v7.Error ReferencePrisma Error ReferencePrisma Client & Prisma schemaPrisma CLI Preview features
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.