Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,42 @@ const prisma = new PrismaClient({ adapter })

If you went through the previous steps, you can query your database as you're used to with Prisma Client. No other changes are needed.

## Usage with Prisma Accelerate or Prisma Postgres

When using the Rust-free version of Prisma ORM with [Prisma Accelerate](/accelerate) or [Prisma Postgres](/postgres), you **should not** use driver adapters. Instead, you can directly instantiate Prisma Client with the appropriate extension.

### 1. Set `engineType` on the `generator` block

```prisma file=schema.prisma
generator client {
provider = "prisma-client" // or `prisma-client-js`
output = "../generated/prisma"
engineType = "client" // enable Prisma ORM without Rust
}
```

### 2. Re-generate Prisma Client

To make the configuration take effect, you need re-generate Prisma Client:

```terminal
npx prisma generate
```

### 3. Instantiate Prisma Client with Accelerate

Import and instantiate Prisma Client with the Accelerate extension:

```typescript
import { PrismaClient } from "./generated/prisma";
import { withAccelerate } from "@prisma/extension-accelerate";

const prisma = new PrismaClient().$extends(withAccelerate());
```
### 4. Query your database

If you went through the previous steps, you can query your database as you're used to with Prisma Client. No other changes are needed.

## Usage with older versions (Preview)

The Rust-free version of Prisma ORM has been in Preview from versions v6.7.0 to v.6.14.0. Expand below if you're using any of these versions and are unable to upgrade to the latest one.
Expand Down
Loading