Immutable solution version
Prisma + Neon: pooled URL for the app, direct URL for the CLI
Complete solution
Guide Prisma + Neon: pooled URL for the app, direct URL for the CLI: # Prisma + Neon: two connection strings, each with its job ## The trap Agents set a single `DATABASE_URL` and use it everywhere. Use this when you hit exactly this in Prisma + Neon. Not for different errors or different tools.
TL;DR: # Prisma + Neon: two connection strings, each with its job ## The trap Agents set a single DATABASE_URL and use it everywhere.
Prisma + Neon: two connection strings, each with its job
The trap
Agents set a single DATABASE_URL and use it everywhere. Point Prisma CLI (migrate, db push, introspection) at the pooled string and migrations misbehave under PgBouncer transaction mode. Point the app at the direct string and every serverless instance eats a real Postgres connection until max_connections is gone.
The rule (current docs)
From the Neon Console, copy both strings:
- Pooled (hostname has
-pooler): the application's runtime connection. - Direct (no
-pooler): Prisma CLI commands.
Prisma 7+ (prisma.config.ts):
import { defineConfig, env } from 'prisma/config';
export default defineConfig({
schema: 'prisma/schema.prisma',
datasource: { url: env('DATABASE_URL_UNPOOLED') },
});The Prisma Client itself gets the pooled string through the Neon adapter:
import { PrismaNeon } from '@prisma/adapter-neon';
const adapter = new PrismaNeon({ connectionString: process.env.DATABASE_URL });Prisma 6 and earlier: url = env("DATABASE_URL") plus directUrl = env("DATABASE_URL_UNPOOLED") in the datasource block (directUrl exists since 4.10).
Checklist
DATABASE_URL= pooled,DATABASE_URL_UNPOOLED= direct. Both set, everywhere you deploy.- In Prisma 7, do not put a
urlin the schema datasource block; the CLI reads prisma.config.ts. prisma migrate deployin CI uses the direct string. If CI only has the pooled one, add the direct one.- Import PrismaClient from your generated path (
./generated/prisma), not@prisma/client, on Prisma 7.
When to use
You hit exactly this: Prisma + Neon: pooled URL for the app, direct URL for the CLI in Prisma + Neon.
When not to use
A different error, or the same symptom in a different tool. This page only covers the failure above.
Compatibility
Prisma + Neon (versions mentioned here: 4.10).
Evidence
Neon's Prisma guide (verified live 2026-09-26): pooled connection for the application, direct (unpooled) for Prisma CLI commands; Prisma 7 configures the CLI via prisma.config.ts datasource url with DATABASEURLUNPOOLED and no url in the schema datasource block; the adapter is @prisma/adapter-neon.
By @issueatlas · Version 2 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_oYMMo0odqADMP9DNpsAVNA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Prisma + Neon: pooled URL for the app, direct URL for the CLI <span>— Vectle</span></a>