Connect to Prisma Postgres without Accelerate
This guide is for existing Prisma Postgres applications that connect through a hosted prisma+postgres://accelerate.prisma-data.net URL. It changes only how your application connects: your database, data, workspace, and plan remain unchanged.
The hosted Accelerate connection will be retired on December 1, 2026. This guide does not apply to Local Postgres URLs such as prisma+postgres://localhost:51213.
Confirm that the deployed application receives a hosted Accelerate URL:
prisma+postgres://accelerate.prisma-data.net/?api_key=__API_KEY__Search your application source, build scripts, and deployment configuration for:
prisma+postgres://accelerate.prisma-data.net
withAccelerate
accelerateUrl
@prisma/extension-accelerate
@prisma/client/edge
cacheStrategy
withAccelerateInfo
$accelerate
--no-engine
--accelerate
--data-proxyRecord every match before making changes. This makes it easier to confirm that the old integration has been removed later.
| Runtime | Recommended connection | Prisma ORM adapter |
|---|---|---|
| Conventional Node.js or Bun runtime with PostgreSQL TCP support | Pooled TCP | @prisma/adapter-pg for Prisma ORM 7 |
| Edge or TCP-constrained runtime | Prisma Postgres serverless driver | @prisma/adapter-ppg |
| Migrations, introspection, Prisma Studio, and administrative commands | Direct TCP | Not applicable |
Use the pooled connection for application traffic when the runtime supports PostgreSQL over TCP. Use the serverless driver when the runtime provides fetch and WebSocket APIs but cannot use a conventional PostgreSQL TCP driver.
Keep a separate direct connection string for Prisma CLI commands. The serverless driver also accepts this direct connection-string format as its credential, but it communicates with Prisma Postgres over HTTP and WebSockets rather than opening a TCP connection.
In the Prisma Console:
- Select the Prisma Postgres database used by your application.
- Choose Connect to your database.
- Generate a connection string.
- Copy the pooled and direct values required for the path you chose.
The generated values look like these placeholders:
# Application traffic over pooled TCP
DATABASE_URL="postgres://USER:PASSWORD@pooled.db.prisma.io:5432/postgres?sslmode=require"
# Prisma CLI commands, or application traffic through the serverless driver
DIRECT_URL="postgres://USER:PASSWORD@db.prisma.io:5432/postgres?sslmode=require"Do not edit the hostname or credentials in an existing connection string. Generate the connection strings in Console so that each value has the correct permissions and routing.
Follow the tab for your Prisma ORM version and the connection path you selected. If you use a Prisma 6 release older than 6.19, update prisma and @prisma/client to 6.19 first.
bun remove @prisma/extension-accelerate
bun add @prisma/adapter-pg pgpnpm remove @prisma/extension-accelerate
pnpm add @prisma/adapter-pg pgyarn remove @prisma/extension-accelerate
yarn add @prisma/adapter-pg pgnpm uninstall @prisma/extension-accelerate
npm install @prisma/adapter-pg pg bun remove @prisma/extension-accelerate
bun add prisma@6.19.3 @prisma/client@6.19.3
```For Prisma ORM 7, point prisma.config.ts at the direct URL so that Prisma CLI commands stop using the Accelerate URL, then configure Prisma Client with the pooled URL and the pg driver adapter. Adjust the Prisma Client import path to match the output directory in your generator block:
import "dotenv/config";
import { defineConfig, env } from "prisma/config";
export default defineConfig({
schema: "prisma/schema.prisma",
datasource: {
url: env("DIRECT_URL"),
},
});import { PrismaPg } from "@prisma/adapter-pg";
import { PrismaClient } from "../../generated/prisma/client";
const adapter = new PrismaPg({
connectionString: process.env.DATABASE_URL!,
});
export const prisma = new PrismaClient({ adapter });For Prisma 6.19, restore the normal engine-backed client. Remove engineType = "client" if it was added for Accelerate, along with --no-engine, --accelerate, or --data-proxy from the generate command. Then use the pooled URL as the datasource URL:
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
directUrl = env("DIRECT_URL")
}import { PrismaClient } from "@prisma/client";
export const prisma = new PrismaClient();bun remove @prisma/extension-accelerate
bun add @prisma/adapter-ppg @prisma/ppgpnpm remove @prisma/extension-accelerate
pnpm add prisma@6.19.3 @prisma/client@6.19.3yarn remove @prisma/extension-accelerate
yarn add prisma@6.19.3 @prisma/client@6.19.3npm uninstall @prisma/extension-accelerate
npm install prisma@6.19.3 @prisma/client@6.19.3For Prisma ORM 7, point prisma.config.ts at the direct URL so that Prisma CLI commands stop using the Accelerate URL, then configure Prisma Client with the pooled URL and the pg driver adapter. Adjust the Prisma Client import path to match the output directory in your generator block:
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
directUrl = env("DIRECT_URL")
}import { PrismaClient } from "@prisma/client";
export const prisma = new PrismaClient();Use the direct connection string as the serverless driver's credential:
DATABASE_URL="postgres://USER:PASSWORD@db.prisma.io:5432/postgres?sslmode=require"For Prisma ORM 7, point prisma.config.ts at the same direct URL so that Prisma CLI commands stop using the Accelerate URL, then instantiate Prisma Client with PrismaPostgresAdapter:
import "dotenv/config";
import { defineConfig, env } from "prisma/config";
export default defineConfig({
schema: "prisma/schema.prisma",
datasource: {
url: env("DATABASE_URL"),
},
});import { PrismaPostgresAdapter } from "@prisma/adapter-ppg";
import { PrismaClient } from "../../generated/prisma/client";
const adapter = new PrismaPostgresAdapter({
connectionString: process.env.DATABASE_URL!,
});
export const prisma = new PrismaClient({ adapter });For Prisma 6.19, keep an engine-less client and replace the Accelerate extension with the serverless driver adapter:
generator client {
provider = "prisma-client"
output = "../generated/prisma"
engineType = "client"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}import { PrismaPostgresAdapter } from "@prisma/adapter-ppg";
import { PrismaClient } from "../../generated/prisma/client";
const adapter = new PrismaPostgresAdapter({
connectionString: process.env.DATABASE_URL!,
});
export const prisma = new PrismaClient({ adapter });For an edge deployment, also set the generator's runtime to the target environment, such as workerd, vercel-edge, or deno. Adjust the Prisma Client import path if your generator uses a different output directory.
Generate Prisma Client after changing the configuration:
bunx prisma generatepnpm remove @prisma/extension-accelerate
pnpm add @prisma/adapter-ppg @prisma/ppgyarn remove @prisma/extension-accelerate
yarn add @prisma/adapter-ppg @prisma/ppgnpm uninstall @prisma/extension-accelerate
npm install @prisma/adapter-ppg @prisma/ppgPrisma ORM 8 does not use this hosted Accelerate integration. If your project is already on Prisma ORM 8, this guide does not apply.
Remove all of the following from the application:
- the
@prisma/extension-acceleratedependency and import withAccelerate()and theaccelerateUrlconstructor option@prisma/client/edgeimports; import Prisma Client from@prisma/client(Prisma 6.19 with the bundled engine) or from your generator'soutputdirectory instead- a
prisma.config.tsdatasourceurlthat still resolves to the Accelerate URL cacheStrategyquery arguments.withAccelerateInfo()calls$accelerate.invalidate()and$accelerate.invalidateAll()calls- legacy
--no-engine,--accelerate, and--data-proxygeneration flags that are not required by the replacement configuration
Cached queries become ordinary database queries. This can change database load and response latency, so validate the affected application paths under representative traffic before completing the cutover.
Typed projects should report removed Accelerate APIs during type checking. Untyped code, skipped checks, or casts can defer the error until Prisma Client validates the query at runtime, so perform the source search even if the build succeeds.
-
Update the connection secrets in local, preview, production, and CI environments.
-
Run Prisma validation and generation:
Bash bunx prisma validate bunx prisma generateTerminal pnpm remove @prisma/extension-accelerate pnpm add prisma@6.19.3 @prisma/client@6.19.3 @prisma/adapter-ppg @prisma/ppgTerminal yarn remove @prisma/extension-accelerate yarn add prisma@6.19.3 @prisma/client@6.19.3 @prisma/adapter-ppg @prisma/ppgTerminal npm uninstall @prisma/extension-accelerate npm install prisma@6.19.3 @prisma/client@6.19.3 @prisma/adapter-ppg @prisma/ppgUse the direct connection string as the serverless driver's credential:
.env DATABASE_URL="postgres://USER:PASSWORD@db.prisma.io:5432/postgres?sslmode=require"For Prisma ORM 7, point
prisma.config.tsat the same direct URL so that Prisma CLI commands stop using the Accelerate URL, then instantiate Prisma Client withPrismaPostgresAdapter: -
Run type checking and your automated test suite.
-
Deploy to a preview environment and verify reads, writes, and transactions.
-
Run the project's normal migration or introspection command using the direct connection.
-
Repeat the source search from step 1 and confirm that no hosted Accelerate URL, extension, caching API, or obsolete generation flag remains.
-
Test representative concurrency while monitoring database connections, timeouts, latency, and errors.
-
Deploy the replacement connection to production and confirm that the runtime no longer receives
prisma+postgres://accelerate.prisma-data.net.
Keep the old Accelerate credential available temporarily as a rollback path. After the replacement connection is stable in production, revoke the old credential and remove the remaining Accelerate configuration.