Skip to main content
Prisma Documentation Docs

Search documentation

Type to search this documentation.

On this pageOverview

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:

Accelerate
prisma+postgres://accelerate.prisma-data.net/?api_key=__API_KEY__

Search your application source, build scripts, and deployment configuration for:

terms"
prisma+postgres://accelerate.prisma-data.net

withAccelerate

accelerateUrl

@prisma/extension-accelerate

@prisma/client/edge

cacheStrategy

withAccelerateInfo

$accelerate

--no-engine

--accelerate

--data-proxy

Record 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:

  1. Select the Prisma Postgres database used by your application.
  2. Choose Connect to your database.
  3. Generate a connection string.
  4. Copy the pooled and direct values required for the path you chose.

The generated values look like these placeholders:

title=".env"
# 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.

Bash
bun remove @prisma/extension-accelerate

bun add @prisma/adapter-pg pg
Terminal
pnpm remove @prisma/extension-accelerate
pnpm add @prisma/adapter-pg pg
Terminal
yarn remove @prisma/extension-accelerate
yarn add @prisma/adapter-pg pg
Terminal
npm uninstall @prisma/extension-accelerate
npm install @prisma/adapter-pg pg
Terminal
    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:

title="prisma.config.ts"
import "dotenv/config";

import { defineConfig, env } from "prisma/config";

export default defineConfig({

  schema: "prisma/schema.prisma",

  datasource: {

    url: env("DIRECT_URL"),

  },

});
title="src/lib/prisma.ts"
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:

title="prisma/schema.prisma"
generator client {

  provider = "prisma-client-js"

}

datasource db {

  provider  = "postgresql"

  url       = env("DATABASE_URL")

  directUrl = env("DIRECT_URL")

}
title="src/lib/prisma.ts"
import { PrismaClient } from "@prisma/client";

export const prisma = new PrismaClient();
Bash
bun remove @prisma/extension-accelerate

bun add @prisma/adapter-ppg @prisma/ppg
Terminal
pnpm remove @prisma/extension-accelerate
pnpm add prisma@6.19.3 @prisma/client@6.19.3
Terminal
yarn remove @prisma/extension-accelerate
yarn add prisma@6.19.3 @prisma/client@6.19.3
Terminal
npm uninstall @prisma/extension-accelerate
npm install 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:

prisma/schema.prisma
generator client {
  provider = "prisma-client-js"
}

datasource db {
  provider  = "postgresql"
  url       = env("DATABASE_URL")
  directUrl = env("DIRECT_URL")
}
src/lib/prisma.ts
import { PrismaClient } from "@prisma/client";

export const prisma = new PrismaClient();

Use the direct connection string as the serverless driver's credential:

title=".env"
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:

title="prisma.config.ts"
import "dotenv/config";

import { defineConfig, env } from "prisma/config";

export default defineConfig({

  schema: "prisma/schema.prisma",

  datasource: {

    url: env("DATABASE_URL"),

  },

});
title="src/lib/prisma.ts"
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:

title="prisma/schema.prisma"
generator client {

  provider   = "prisma-client"

  output     = "../generated/prisma"

  engineType = "client"

}

datasource db {

  provider = "postgresql"

  url      = env("DATABASE_URL")

}
title="src/lib/prisma.ts"
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:

Bash
bunx prisma generate
Terminal
pnpm remove @prisma/extension-accelerate
pnpm add @prisma/adapter-ppg @prisma/ppg
Terminal
yarn remove @prisma/extension-accelerate
yarn add @prisma/adapter-ppg @prisma/ppg
Terminal
npm uninstall @prisma/extension-accelerate
npm install @prisma/adapter-ppg @prisma/ppg

Prisma 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-accelerate dependency and import
  • withAccelerate() and the accelerateUrl constructor option
  • @prisma/client/edge imports; import Prisma Client from @prisma/client (Prisma 6.19 with the bundled engine) or from your generator's output directory instead
  • a prisma.config.ts datasource url that still resolves to the Accelerate URL
  • cacheStrategy query arguments
  • .withAccelerateInfo() calls
  • $accelerate.invalidate() and $accelerate.invalidateAll() calls
  • legacy --no-engine, --accelerate, and --data-proxy generation 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.

  1. Update the connection secrets in local, preview, production, and CI environments.

  2. Run Prisma validation and generation:

    Bash
    bunx prisma validate
    
    bunx prisma generate
    Terminal
    pnpm remove @prisma/extension-accelerate
    pnpm add prisma@6.19.3 @prisma/client@6.19.3 @prisma/adapter-ppg @prisma/ppg
    Terminal
    yarn remove @prisma/extension-accelerate
    yarn add prisma@6.19.3 @prisma/client@6.19.3 @prisma/adapter-ppg @prisma/ppg
    Terminal
    npm uninstall @prisma/extension-accelerate
    npm install prisma@6.19.3 @prisma/client@6.19.3 @prisma/adapter-ppg @prisma/ppg

    Use 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.ts at the same direct URL so that Prisma CLI commands stop using the Accelerate URL, then instantiate Prisma Client with PrismaPostgresAdapter:

  3. Run type checking and your automated test suite.

  4. Deploy to a preview environment and verify reads, writes, and transactions.

  5. Run the project's normal migration or introspection command using the direct connection.

  6. Repeat the source search from step 1 and confirm that no hosted Accelerate URL, extension, caching API, or obsolete generation flag remains.

  7. Test representative concurrency while monitoring database connections, timeouts, latency, and errors.

  8. 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.

Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu