Short answer
Use a pooler connection string instead of the direct db.[project-ref].supabase.co one. For a serverless app on Vercel or similar, set DATABASE_URL to the transaction pooler (port 6543) with ?pgbouncer=true, and DIRECT_URL to the session pooler (port 5432, which works over IPv4) for migrations, and point Prisma’s migrations at DIRECT_URL (directUrl in schema.prisma, or the datasource url in prisma.config.ts on Prisma 7). Copy both from the Connect button in the Supabase dashboard rather than typing them, then redeploy.
Why Prisma can’t connect
01
The host can’t reach the IPv6 direct connection
“If your network is IPv4-only and you don't have the add-on, use session mode instead.” Supabase, Connect to your database
The direct connection works from networks with IPv6 and fails silently from IPv4-only ones, which looks exactly like P1001. Switch to the shared pooler, which is reachable over IPv4.
02
Serverless functions need the transaction pooler
“Make sure to append "pgbouncer=true" to the end of the string, which turns off prepared statements.” Supabase, Prisma
Vercel and other serverless hosts open many short connections. Point DATABASE_URL at the transaction pooler and turn off prepared statements, or you trade this error for prepared statement errors.
03
The connection string is wrong
“Malformed connection string: The connection string used by Prisma is incorrect or incomplete.” Supabase, Prisma troubleshooting
A password with special characters that isn’t URL-encoded, a pooler user without the .project-ref suffix, or a hand-built pooler host all fail the same way. Copy the string from the dashboard.
04
The database is overloaded or paused
“Database overload: The database server is under heavy load, causing Prisma to struggle to connect.” Supabase, Prisma troubleshooting
If the string is right and it still times out, check the database’s CPU and memory in the dashboard, and whether a Free plan project was paused.
Checked against the vendor’s docs on : Supabase docs: Prisma troubleshooting; Supabase docs: Prisma; Supabase docs: Connect to your database.
Rather hand it over?
Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.
- from $450App Fix TicketOne reproducible bug in an existing mobile or web app, diagnosed and fixed.See scope and start
- from $450AI-Built App RescueA Lovable, Bolt or Cursor app checked end to end in 3 days, then its worst problems fixed at a fixed price.No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way.See scope and start
Related: Supabase too many connections · Supabase project paused · Supabase migration failed on db push · Prisma prepared statement already exists