Skip to content

Commit 5d8878d

Browse files
committed
Updates based on what the rabbit said
1 parent 7033a61 commit 5d8878d

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

docs/guides/frameworks/supabase-authentication.mdx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ const supabase = createClient<Database>(
7272
// Your task
7373
```
7474
75-
## Using Prisma with Supabase PgBouncer
75+
## Using Prisma with Supabase Supavisor (connection pooler)
7676
77-
When using Prisma with Supabase's PgBouncer connection pooler, you need separate pooled and direct connection URLs to avoid prepared statement conflicts.
77+
When using Prisma with Supabase's Supavisor pooler, use a pooled URL for Prisma Client and a session/direct URL for schema operations to avoid prepared statement conflicts. As of Feb 28, 2025, port 6543 runs Transaction Mode only; use port 5432 for Session Mode.
7878
7979
```ts
8080
// In trigger.config.ts
@@ -86,13 +86,15 @@ prismaExtension({
8686
8787
```bash
8888
# Environment variables
89-
DATABASE_URL=postgresql://[email protected]:6543/postgres?pgbouncer=true&connection_limit=1
90-
DATABASE_URL_UNPOOLED=postgresql://[email protected]:5432/postgres
89+
# Pooled (Transaction Mode, port 6543)
90+
DATABASE_URL="postgresql://postgres.[PROJECT_REF]:<PASSWORD>@aws-0-[REGION].pooler.supabase.com:6543/postgres?pgbouncer=true&connection_limit=1"
91+
# Session/Direct (used by Prisma schema engine, port 5432)
92+
DATABASE_URL_UNPOOLED="postgresql://postgres.[PROJECT_REF]:<PASSWORD>@aws-0-[REGION].pooler.supabase.com:5432/postgres"
9193
```
9294
9395
<Note>
94-
The pooled connection (port 6543) is used for regular queries, while the direct connection (port
95-
5432) is used for migrations and schema operations that don't work with connection pooling.
96+
Use the pooled connection (port 6543, Transaction Mode) for regular Prisma Client queries. Use the
97+
session/direct connection (port 5432, Session Mode) for migrations and other schema operations.
9698
</Note>
9799
98100
<SupabaseDocsCards />

0 commit comments

Comments
 (0)