From 7f9d9a661843d7232d29796d60de73ec499ed1b1 Mon Sep 17 00:00:00 2001 From: David Astudillo Date: Sun, 19 Apr 2026 19:59:02 -0400 Subject: [PATCH 1/3] Enhance PrismaClient setup with adapter and requirements Updated PrismaClient initialization to include adapter support and added Prisma 7 connection requirements. --- apps/docs/content/docs/orm/index.mdx | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/apps/docs/content/docs/orm/index.mdx b/apps/docs/content/docs/orm/index.mdx index 9ec833cb03..5fe09ac63d 100644 --- a/apps/docs/content/docs/orm/index.mdx +++ b/apps/docs/content/docs/orm/index.mdx @@ -115,8 +115,14 @@ npx prisma generate ```ts import { PrismaClient } from "./generated/client"; +// Import the driver adapter for your specific database +import { PrismaAdapter } from "@prisma/adapter-xyz"; -const prisma = new PrismaClient(); +// Initialize the adapter according to your driver's requirements +const adapter = new PrismaAdapter(...); + +// Pass the adapter instance to PrismaClient +const prisma = new PrismaClient({ adapter }); // Find all users with their posts const users = await prisma.user.findMany({ @@ -133,6 +139,18 @@ const user = await prisma.user.create({ }, }); ``` +:::note + +### Prisma 7 Connection Requirements +Starting with **Prisma 7**, providing a [driver adapter](/orm/core-concepts/supported-databases/database-drivers) is mandatory to connect to your database. This change standardizes database connectivity across Node.js, Serverless, and Edge environments. + +To ensure compatibility: +* **Install an adapter:** Use the specific package for your database (e.g., `@prisma/adapter-pg`, `@prisma/adapter-mysql`, etc.). +* **Enable ESM:** Your `package.json` must include `"type": "module"`. + +For detailed instructions, see the [V7 Upgrade Guide](/guides/upgrade-prisma-orm/v7). + +::: ## Next steps From 39538fd5a997a96028ce27cafb059c2779174749 Mon Sep 17 00:00:00 2001 From: David Astudillo Date: Sun, 19 Apr 2026 20:13:49 -0400 Subject: [PATCH 2/3] Update apps/docs/content/docs/orm/index.mdx Adding suggestions from coderabbitai, resolving the minor issue. Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- apps/docs/content/docs/orm/index.mdx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/docs/content/docs/orm/index.mdx b/apps/docs/content/docs/orm/index.mdx index 5fe09ac63d..b3f6e57e58 100644 --- a/apps/docs/content/docs/orm/index.mdx +++ b/apps/docs/content/docs/orm/index.mdx @@ -142,7 +142,9 @@ const user = await prisma.user.create({ :::note ### Prisma 7 Connection Requirements -Starting with **Prisma 7**, providing a [driver adapter](/orm/core-concepts/supported-databases/database-drivers) is mandatory to connect to your database. This change standardizes database connectivity across Node.js, Serverless, and Edge environments. +Starting with **Prisma 7**, providing a [driver adapter](/orm/core-concepts/supported-databases/database-drivers) is mandatory for direct database connections. This change standardizes database connectivity across Node.js, Serverless, and Edge environments. + +If you use Prisma Accelerate, instantiate Prisma Client with `accelerateUrl` and the Accelerate extension instead of a driver adapter. To ensure compatibility: * **Install an adapter:** Use the specific package for your database (e.g., `@prisma/adapter-pg`, `@prisma/adapter-mysql`, etc.). From 30f0ef3b6c5461d137de2e98668af7495637a493 Mon Sep 17 00:00:00 2001 From: David Astudillo Date: Sun, 19 Apr 2026 20:21:20 -0400 Subject: [PATCH 3/3] Update database adapter to use PrismaPg for PostgreSQL --- apps/docs/content/docs/orm/index.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/docs/content/docs/orm/index.mdx b/apps/docs/content/docs/orm/index.mdx index b3f6e57e58..944d6034b7 100644 --- a/apps/docs/content/docs/orm/index.mdx +++ b/apps/docs/content/docs/orm/index.mdx @@ -115,11 +115,11 @@ npx prisma generate ```ts import { PrismaClient } from "./generated/client"; -// Import the driver adapter for your specific database -import { PrismaAdapter } from "@prisma/adapter-xyz"; +// Import the driver adapter for your specific database (example uses PostgreSQL) +import { PrismaPg } from "@prisma/adapter-pg"; // Initialize the adapter according to your driver's requirements -const adapter = new PrismaAdapter(...); +const adapter = new PrismaPg({ connectionString: process.env.DATABASE_URL }); // Pass the adapter instance to PrismaClient const prisma = new PrismaClient({ adapter });