Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion apps/docs/content/docs/orm/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,14 @@ npx prisma generate

```ts
import { PrismaClient } from "./generated/client";
// Import the driver adapter for your specific database (example uses PostgreSQL)
import { PrismaPg } from "@prisma/adapter-pg";

const prisma = new PrismaClient();
// Initialize the adapter according to your driver's requirements
const adapter = new PrismaPg({ connectionString: process.env.DATABASE_URL });

// Pass the adapter instance to PrismaClient
const prisma = new PrismaClient({ adapter });

// Find all users with their posts
const users = await prisma.user.findMany({
Expand All @@ -133,6 +139,20 @@ 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 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.).
* **Enable ESM:** Your `package.json` must include `"type": "module"`.

For detailed instructions, see the [V7 Upgrade Guide](/guides/upgrade-prisma-orm/v7).

:::

## Next steps

Expand Down