From d63e4c2e7fed6cff2384d16d54c253287360e518 Mon Sep 17 00:00:00 2001 From: Aman Varshney Date: Tue, 14 Oct 2025 16:31:53 +0530 Subject: [PATCH 1/2] docs: add the questions answered section to top 20 pages and guides --- .../20-relations/100-one-to-one-relations.mdx | 9 +++++++++ .../20-relations/200-one-to-many-relations.mdx | 9 +++++++++ .../20-relations/300-many-to-many-relations.mdx | 9 +++++++++ .../20-data-model/20-relations/400-self-relations.mdx | 9 +++++++++ .../100-special-rules-for-referential-actions.mdx | 9 +++++++++ .../20-relations/410-referential-actions/index.mdx | 9 +++++++++ .../20-data-model/20-relations/420-relation-mode.mdx | 9 +++++++++ .../100-connection-management.mdx | 9 +++++++++ .../050-databases-connections/115-connection-pool.mdx | 9 +++++++++ .../050-databases-connections/200-pgbouncer.mdx | 9 +++++++++ .../500-middleware/100-soft-delete-middleware.mdx | 9 +++++++++ .../101-traditional/225-deploy-to-render.mdx | 9 +++++++++ .../201-serverless/400-deploy-to-aws-lambda.mdx | 9 +++++++++ .../500-deployment/301-edge/100-overview.mdx | 9 +++++++++ .../500-deployment/301-edge/450-deploy-to-cloudflare.mdx | 9 +++++++++ .../500-deployment/301-edge/485-deploy-to-vercel.mdx | 9 +++++++++ .../200-upgrading-versions/500-upgrading-to-prisma-6.mdx | 9 +++++++++ .../03-upgrading-the-prisma-layer-postgresql.mdx | 9 +++++++++ content/800-guides/090-nextjs.mdx | 9 +++++++++ content/800-guides/130-docker.mdx | 9 +++++++++ content/800-guides/220-astro.mdx | 9 +++++++++ 21 files changed, 189 insertions(+) diff --git a/content/200-orm/100-prisma-schema/20-data-model/20-relations/100-one-to-one-relations.mdx b/content/200-orm/100-prisma-schema/20-data-model/20-relations/100-one-to-one-relations.mdx index 577a7a80e8..4d92e087ae 100644 --- a/content/200-orm/100-prisma-schema/20-data-model/20-relations/100-one-to-one-relations.mdx +++ b/content/200-orm/100-prisma-schema/20-data-model/20-relations/100-one-to-one-relations.mdx @@ -10,6 +10,15 @@ This page introduces one-to-one relations and explains how to use them in your P +
+Questions answered in this page + +- How do I model one-to-one relations? +- Which side should store the foreign key? +- How do optional vs required 1-1 work? + +
+ ## Overview One-to-one (1-1) relations refer to relations where at most **one** record can be connected on both sides of the relation. In the example below, there is a one-to-one relation between `User` and `Profile`: diff --git a/content/200-orm/100-prisma-schema/20-data-model/20-relations/200-one-to-many-relations.mdx b/content/200-orm/100-prisma-schema/20-data-model/20-relations/200-one-to-many-relations.mdx index 8a46de8dec..3472d120d9 100644 --- a/content/200-orm/100-prisma-schema/20-data-model/20-relations/200-one-to-many-relations.mdx +++ b/content/200-orm/100-prisma-schema/20-data-model/20-relations/200-one-to-many-relations.mdx @@ -6,6 +6,15 @@ tocDepth: 3 This page introduces one-to-many relations and explains how to use them in your Prisma schema. +
+Questions answered in this page + +- How do I model one-to-many relations? +- Which side holds the foreign key in 1-n? +- How do optional vs required 1-n work? + +
+ ## Overview One-to-many (1-n) relations refer to relations where one record on one side of the relation can be connected to zero or more records on the other side. In the following example, there is one one-to-many relation between the `User` and `Post` models: diff --git a/content/200-orm/100-prisma-schema/20-data-model/20-relations/300-many-to-many-relations.mdx b/content/200-orm/100-prisma-schema/20-data-model/20-relations/300-many-to-many-relations.mdx index 0107236e16..587c78fbbe 100644 --- a/content/200-orm/100-prisma-schema/20-data-model/20-relations/300-many-to-many-relations.mdx +++ b/content/200-orm/100-prisma-schema/20-data-model/20-relations/300-many-to-many-relations.mdx @@ -12,6 +12,15 @@ Prisma schema syntax and the implementation in the underlying database differs b +
+Questions answered in this page + +- How do I model many-to-many in Prisma? +- When to use implicit vs explicit m-n? +- How do I query m-n relations? + +
+ ## Relational databases In relational databases, m-n-relations are typically modelled via [relation tables](/orm/prisma-schema/data-model/relations/many-to-many-relations#relation-tables). m-n-relations can be either [explicit](#explicit-many-to-many-relations) or [implicit](#implicit-many-to-many-relations) in the Prisma schema. We recommend using [implicit](#implicit-many-to-many-relations) m-n-relations if you do not need to store any additional meta-data in the relation table itself. You can always migrate to an [explicit](#explicit-many-to-many-relations) m-n-relation later if needed. diff --git a/content/200-orm/100-prisma-schema/20-data-model/20-relations/400-self-relations.mdx b/content/200-orm/100-prisma-schema/20-data-model/20-relations/400-self-relations.mdx index db9e12e34b..d06f36df6f 100644 --- a/content/200-orm/100-prisma-schema/20-data-model/20-relations/400-self-relations.mdx +++ b/content/200-orm/100-prisma-schema/20-data-model/20-relations/400-self-relations.mdx @@ -5,6 +5,15 @@ metaDescription: How to define and work with self-relations in Prisma. A relation field can also reference its own model, in this case the relation is called a _self-relation_. Self-relations can be of any cardinality, 1-1, 1-n and m-n. +
+Questions answered in this page + +- How do I model self-relations? +- Do self-relations always require @relation? +- How do 1-1 vs 1-n self-relations differ? + +
+ Note that self-relations always require the `@relation` attribute. ## One-to-one self-relations diff --git a/content/200-orm/100-prisma-schema/20-data-model/20-relations/410-referential-actions/100-special-rules-for-referential-actions.mdx b/content/200-orm/100-prisma-schema/20-data-model/20-relations/410-referential-actions/100-special-rules-for-referential-actions.mdx index 5a90ac3256..15634236d5 100644 --- a/content/200-orm/100-prisma-schema/20-data-model/20-relations/410-referential-actions/100-special-rules-for-referential-actions.mdx +++ b/content/200-orm/100-prisma-schema/20-data-model/20-relations/410-referential-actions/100-special-rules-for-referential-actions.mdx @@ -38,6 +38,15 @@ In more complicated data models, finding the cascade paths can get complex. Ther +
+Questions answered in this page + +- How do I fix cascade cycles on SQL Server? +- Do MongoDB self-relations require NoAction? +- How do I handle multiple cascade paths? + +
+ ## Self-relation (SQL Server and MongoDB) The following model describes a self-relation where an `Employee` can have a manager and managees, referencing entries of the same model. diff --git a/content/200-orm/100-prisma-schema/20-data-model/20-relations/410-referential-actions/index.mdx b/content/200-orm/100-prisma-schema/20-data-model/20-relations/410-referential-actions/index.mdx index 2e0d6ccc7f..bbef7dc445 100644 --- a/content/200-orm/100-prisma-schema/20-data-model/20-relations/410-referential-actions/index.mdx +++ b/content/200-orm/100-prisma-schema/20-data-model/20-relations/410-referential-actions/index.mdx @@ -41,6 +41,15 @@ If you do not specify a referential action, Prisma ORM [uses a default](#referen +
+Questions answered in this page + +- What do referential actions do? +- Which defaults apply if none are set? +- How do actions map to my database? + +
+ If you upgrade from a version earlier than 2.26.0: diff --git a/content/200-orm/100-prisma-schema/20-data-model/20-relations/420-relation-mode.mdx b/content/200-orm/100-prisma-schema/20-data-model/20-relations/420-relation-mode.mdx index a054e7d778..99aa146c36 100644 --- a/content/200-orm/100-prisma-schema/20-data-model/20-relations/420-relation-mode.mdx +++ b/content/200-orm/100-prisma-schema/20-data-model/20-relations/420-relation-mode.mdx @@ -5,6 +5,15 @@ metaDescription: 'Manage relations between records with relation modes in Prisma tocDepth: 3 --- +
+Questions answered in this page + +- What is `relationMode` in Prisma? +- When should I use `prisma` vs `foreignKeys`? +- How does relation emulation affect constraints? + +
+ In Prisma schema, relations between records are defined with the [`@relation`](/orm/reference/prisma-schema-reference#relation) attribute. For example, in the following schema there is a one-to-many relation between the `User` and `Post` models: ```prisma file=schema.prisma highlight=4,5,10;normal showLineNumbers diff --git a/content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/100-connection-management.mdx b/content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/100-connection-management.mdx index 023aba982d..241f4a247b 100644 --- a/content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/100-connection-management.mdx +++ b/content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/100-connection-management.mdx @@ -16,6 +16,15 @@ In most cases, you **do not need to explicitly call these methods**. `PrismaClie See the [connection management guide](/orm/prisma-client/setup-and-configuration/databases-connections) for information about managing connections for different deployment paradigms (long-running processes and serverless functions). +
+Questions answered in this page + +- When should I call $connect and $disconnect? +- How does Prisma manage connection pools? +- How to handle connections in serverless? + +
+ ## `$connect()` diff --git a/content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/115-connection-pool.mdx b/content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/115-connection-pool.mdx index a04ac9dc56..ba25506e73 100644 --- a/content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/115-connection-pool.mdx +++ b/content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/115-connection-pool.mdx @@ -12,6 +12,15 @@ The query engine manages a **connection pool** of database connections. The pool Relational database connectors use Prisma ORM's own connection pool, and the MongoDB connectors uses the [MongoDB driver connection pool](https://github.com/mongodb/specifications/blob/master/source/connection-monitoring-and-pooling/connection-monitoring-and-pooling.rst). +
+Questions answered in this page + +- How do I size Prisma's connection pool? +- How do I set pool timeouts and limits? +- When should I use PgBouncer with Prisma? + +
+ :::note As of [v6.16.0](https://pris.ly/release/6.16.0), Prisma ORM can be used without Rust engines in production applications. Learn more [here](/orm/prisma-client/setup-and-configuration/no-rust-engine). diff --git a/content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/200-pgbouncer.mdx b/content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/200-pgbouncer.mdx index 9b5b5b9b6f..6696f6d36d 100644 --- a/content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/200-pgbouncer.mdx +++ b/content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/200-pgbouncer.mdx @@ -7,6 +7,15 @@ An external connection pooler like PgBouncer holds a connection pool to the data Usually, this works transparently, but some connection poolers only support a limited set of functionality. One common feature that external connection poolers do not support are named prepared statements, which Prisma ORM uses. For these cases, Prisma ORM can be configured to behave differently. +
+Questions answered in this page + +- How do I configure Prisma with PgBouncer? +- Do I need pgbouncer=true and when? +- How does Prisma Migrate work with PgBouncer? + +
+ :::info Looking for an easy, infrastructure-free solution? Try [Prisma Accelerate](https://www.prisma.io/accelerate?utm_source=docs&utm_campaign=pgbouncer-help)! It requires little to no setup and works seamlessly with all databases supported by Prisma ORM. diff --git a/content/200-orm/200-prisma-client/300-client-extensions/500-middleware/100-soft-delete-middleware.mdx b/content/200-orm/200-prisma-client/300-client-extensions/500-middleware/100-soft-delete-middleware.mdx index b44123c383..cdfe0ac784 100644 --- a/content/200-orm/200-prisma-client/300-client-extensions/500-middleware/100-soft-delete-middleware.mdx +++ b/content/200-orm/200-prisma-client/300-client-extensions/500-middleware/100-soft-delete-middleware.mdx @@ -67,6 +67,15 @@ model Tag { +
+Questions answered in this page + +- How to implement soft delete middleware? +- How to block reads/updates of deleted records? +- What are trade-offs of middleware-based soft delete? + +
+ ## Step 1: Store status of record Add a field named `deleted` to the `Post` model. You can choose between two field types depending on your requirements: diff --git a/content/200-orm/200-prisma-client/500-deployment/101-traditional/225-deploy-to-render.mdx b/content/200-orm/200-prisma-client/500-deployment/101-traditional/225-deploy-to-render.mdx index 6b43e2861c..41526c1bd8 100644 --- a/content/200-orm/200-prisma-client/500-deployment/101-traditional/225-deploy-to-render.mdx +++ b/content/200-orm/200-prisma-client/500-deployment/101-traditional/225-deploy-to-render.mdx @@ -7,6 +7,15 @@ metaDescription: 'Learn how to deploy a Node.js server that uses Prisma ORM to R This guide explains how to deploy a Node.js server that uses Prisma ORM and PostgreSQL to Render. +
+Questions answered in this page + +- How to deploy Prisma apps on Render? +- How to run migrations before start? +- What Render settings are recommended? + +
+ The [Prisma Render deployment example](https://github.com/prisma/prisma-examples/tree/latest/deployment-platforms/render) contains an Express.js application with REST endpoints and a simple frontend. This app uses Prisma Client to fetch, create, and delete records from its database. ## About Render diff --git a/content/200-orm/200-prisma-client/500-deployment/201-serverless/400-deploy-to-aws-lambda.mdx b/content/200-orm/200-prisma-client/500-deployment/201-serverless/400-deploy-to-aws-lambda.mdx index 9f1a1fa592..fc386c5aa4 100644 --- a/content/200-orm/200-prisma-client/500-deployment/201-serverless/400-deploy-to-aws-lambda.mdx +++ b/content/200-orm/200-prisma-client/500-deployment/201-serverless/400-deploy-to-aws-lambda.mdx @@ -8,6 +8,15 @@ tocDepth: 3 This guide explains how to avoid common issues when deploying a project using Prisma ORM to [AWS Lambda](https://aws.amazon.com/lambda/). +
+Questions answered in this page + +- How to deploy Prisma to AWS Lambda? +- Which binaryTargets should I configure? +- How to handle connection pooling on Lambda? + +
+ While a deployment framework is not required to deploy to AWS Lambda, this guide covers deploying with: - [AWS Serverless Application Model (SAM)](https://aws.amazon.com/serverless/sam/) is an open-source framework from AWS that can be used in the creation of serverless applications. AWS SAM includes the [AWS SAM CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-reference.html#serverless-sam-cli), which you can use to build, test, and deploy your application. diff --git a/content/200-orm/200-prisma-client/500-deployment/301-edge/100-overview.mdx b/content/200-orm/200-prisma-client/500-deployment/301-edge/100-overview.mdx index b51594e6ee..3463416c74 100644 --- a/content/200-orm/200-prisma-client/500-deployment/301-edge/100-overview.mdx +++ b/content/200-orm/200-prisma-client/500-deployment/301-edge/100-overview.mdx @@ -8,6 +8,15 @@ tocDepth: 2 You can deploy an application that uses Prisma ORM to the edge. Depending on which edge function provider and which database you use, there are different considerations and things to be aware of. +
+Questions answered in this page + +- Which database drivers work on edge? +- How do driver adapters affect connections? +- When to use Prisma Postgres or Accelerate? + +
+ Here is a brief overview of all the edge function providers that are currently supported by Prisma ORM: | Provider / Product | Supported natively with Prisma ORM | Supported with Prisma Postgres (and Prisma Accelerate)| diff --git a/content/200-orm/200-prisma-client/500-deployment/301-edge/450-deploy-to-cloudflare.mdx b/content/200-orm/200-prisma-client/500-deployment/301-edge/450-deploy-to-cloudflare.mdx index b3a9a00a28..c12f9ddf1e 100644 --- a/content/200-orm/200-prisma-client/500-deployment/301-edge/450-deploy-to-cloudflare.mdx +++ b/content/200-orm/200-prisma-client/500-deployment/301-edge/450-deploy-to-cloudflare.mdx @@ -8,6 +8,15 @@ tocDepth: 3 This page covers everything you need to know to deploy an app with Prisma ORM to a [Cloudflare Worker](https://developers.cloudflare.com/workers/) or to [Cloudflare Pages](https://developers.cloudflare.com/pages). +
+Questions answered in this page + +- How to deploy Prisma to Cloudflare Workers? +- Which drivers work on Workers/Pages? +- How to configure DATABASE_URL and envs? + +
+ :::tip Use Prisma ORM without Rust binaries If Prisma ORM's Rust engine binaries cause large bundle sizes, slow builds, or deployment issues (for example, in serverless or edge environments), you can use it without them using this configuration of your `generator` block: diff --git a/content/200-orm/200-prisma-client/500-deployment/301-edge/485-deploy-to-vercel.mdx b/content/200-orm/200-prisma-client/500-deployment/301-edge/485-deploy-to-vercel.mdx index 96bb160e47..bab4e03d21 100644 --- a/content/200-orm/200-prisma-client/500-deployment/301-edge/485-deploy-to-vercel.mdx +++ b/content/200-orm/200-prisma-client/500-deployment/301-edge/485-deploy-to-vercel.mdx @@ -9,6 +9,15 @@ sidebar_class_name: preview-badge This page covers everything you need to know to deploy an app that uses Prisma Client for talking to a database in [Vercel Edge Middleware](https://vercel.com/docs/functions/edge-middleware) or a [Vercel Function](https://vercel.com/docs/functions) deployed to the [Vercel Edge Runtime](https://vercel.com/docs/functions/runtimes/edge-runtime). +
+Questions answered in this page + +- How to deploy Prisma on Vercel Edge? +- Which database drivers are supported? +- How to configure env and postinstall? + +
+ Vercel supports both Node.js and edge runtimes for Vercel Functions. The Node.js runtime is the default and recommended for most use cases. :::note diff --git a/content/200-orm/800-more/300-upgrade-guides/200-upgrading-versions/500-upgrading-to-prisma-6.mdx b/content/200-orm/800-more/300-upgrade-guides/200-upgrading-versions/500-upgrading-to-prisma-6.mdx index a93ef7441e..180853f6d7 100644 --- a/content/200-orm/800-more/300-upgrade-guides/200-upgrading-versions/500-upgrading-to-prisma-6.mdx +++ b/content/200-orm/800-more/300-upgrade-guides/200-upgrading-versions/500-upgrading-to-prisma-6.mdx @@ -8,6 +8,15 @@ toc: true Prisma ORM v6 introduces a number of **breaking changes** when you upgrade from an earlier Prisma ORM version. This guide explains how this upgrade might affect your application and gives instructions on how to handle any changes. +
+Questions answered in this page + +- What changed in Prisma 6? +- How do I upgrade safely? +- Which breaking changes affect my app? + +
+ ## Upgrade the `prisma` and `@prisma/client` packages to v6 To upgrade to Prisma ORM v6 from an earlier version, you need to update both the `prisma` and `@prisma/client` packages: diff --git a/content/200-orm/800-more/300-upgrade-guides/800-upgrade-from-prisma-1/03-upgrading-the-prisma-layer-postgresql.mdx b/content/200-orm/800-more/300-upgrade-guides/800-upgrade-from-prisma-1/03-upgrading-the-prisma-layer-postgresql.mdx index d15d7bcca7..eb250661e0 100644 --- a/content/200-orm/800-more/300-upgrade-guides/800-upgrade-from-prisma-1/03-upgrading-the-prisma-layer-postgresql.mdx +++ b/content/200-orm/800-more/300-upgrade-guides/800-upgrade-from-prisma-1/03-upgrading-the-prisma-layer-postgresql.mdx @@ -12,6 +12,15 @@ slugSwitch: /orm/more/upgrade-guides/upgrade-from-prisma-1/upgrading-the-prisma- This page explains the first step of your upgrade process: Taking your Prisma 1 configuration and upgrading it to Prisma ORM 2. Concretely, you will learn how to: +
+Questions answered in this page + +- What are Prisma 1 → 2 schema incompatibilities? +- How to resolve Postgres-specific differences? +- How to use the upgrade CLI safely? + +
+ 1. Add the Prisma ORM 2 CLI as a development dependency 1. Create your Prisma ORM 2 schema 1. Determine your connection URL and connect to your database diff --git a/content/800-guides/090-nextjs.mdx b/content/800-guides/090-nextjs.mdx index 885bea7297..d474cacbbe 100644 --- a/content/800-guides/090-nextjs.mdx +++ b/content/800-guides/090-nextjs.mdx @@ -13,6 +13,15 @@ community_section: true ## Introduction +
+Questions answered in this page + +- How to set up Prisma with Next.js? +- How to deploy Next.js with Prisma to Vercel? +- How to handle migrations in production? + +
+ This guide shows you how to use Prisma with Next.js 15, a fullstack React framework. You'll learn how to create a [Prisma Postgres](/postgres/) instance, set up Prisma ORM with Next.js, handle migrations, and deploy your application to Vercel. You can find a [deployment-ready example on GitHub](https://github.com/prisma/prisma-examples/blob/latest/orm/nextjs). diff --git a/content/800-guides/130-docker.mdx b/content/800-guides/130-docker.mdx index 466ab73303..b6d6e1684d 100644 --- a/content/800-guides/130-docker.mdx +++ b/content/800-guides/130-docker.mdx @@ -12,6 +12,15 @@ tags: community_section: true --- +
+Questions answered in this page + +- How to run Prisma in Docker containers? +- How to configure Docker Compose with Prisma? +- How to handle migrations in Docker? + +
+ This guide walks you through setting up a Prisma ORM application within a Docker environment. You'll learn how to configure a Node.js project, integrate Prisma for database management, and orchestrate the application using Docker Compose. By the end, you'll have a fully functional Prisma application running in a Docker container. ## Prerequisites diff --git a/content/800-guides/220-astro.mdx b/content/800-guides/220-astro.mdx index 01e84cba9d..bbc5306ac2 100644 --- a/content/800-guides/220-astro.mdx +++ b/content/800-guides/220-astro.mdx @@ -10,6 +10,15 @@ community_section: true ## Introduction +
+Questions answered in this page + +- How to integrate Prisma with Astro? +- How to set up Prisma Postgres in Astro? +- How to query data in Astro pages? + +
+ Prisma ORM offers type-safe database access, and [Astro](https://astro.build/) is built for performance. Together with [Prisma Postgres](https://www.prisma.io/postgres), you get a fast, content-first stack with zero cold starts and end-to-end speed. In this guide, you'll learn to integrate Prisma ORM with a Prisma Postgres database in an Astro project from scratch. You can find a complete example of this guide on [GitHub](https://github.com/prisma/prisma-examples/tree/latest/orm/astro). From 3ba7c24dccccc299d091f19d3e4406972a16fa10 Mon Sep 17 00:00:00 2001 From: Aman Varshney Date: Tue, 14 Oct 2025 17:07:48 +0530 Subject: [PATCH 2/2] reword question bullet --- .../050-databases-connections/200-pgbouncer.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/200-pgbouncer.mdx b/content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/200-pgbouncer.mdx index 6696f6d36d..744c8a3b3a 100644 --- a/content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/200-pgbouncer.mdx +++ b/content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/200-pgbouncer.mdx @@ -11,7 +11,7 @@ Usually, this works transparently, but some connection poolers only support a li Questions answered in this page - How do I configure Prisma with PgBouncer? -- Do I need pgbouncer=true and when? +- Do I need `pgbouncer=true`, and if so, when? - How does Prisma Migrate work with PgBouncer?