Skip to content

Commit 29c9c88

Browse files
committed
Moved the supavisor section to the prismaExtension docs
1 parent 5d8878d commit 29c9c88

File tree

2 files changed

+24
-25
lines changed

2 files changed

+24
-25
lines changed

docs/config/extensions/prismaExtension.mdx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,30 @@ If you're experiencing database connection issues during deployment, you may nee
141141

142142
</Note>
143143

144+
### Using with Supabase Supavisor
145+
146+
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.
147+
148+
```ts
149+
prismaExtension({
150+
schema: "prisma/schema.prisma",
151+
directUrlEnvVarName: "DATABASE_URL_UNPOOLED",
152+
}),
153+
```
154+
155+
```bash
156+
# Environment variables
157+
# Pooled (Transaction Mode, port 6543)
158+
DATABASE_URL="postgresql://postgres.[PROJECT_REF]:<PASSWORD>@aws-0-[REGION].pooler.supabase.com:6543/postgres?pgbouncer=true&connection_limit=1"
159+
# Session/Direct (used by Prisma schema engine, port 5432)
160+
DATABASE_URL_UNPOOLED="postgresql://postgres.[PROJECT_REF]:<PASSWORD>@aws-0-[REGION].pooler.supabase.com:5432/postgres"
161+
```
162+
163+
<Note>
164+
Use the pooled connection (port 6543, Transaction Mode) for regular Prisma Client queries. Use the
165+
session/direct connection (port 5432, Session Mode) for migrations and other schema operations.
166+
</Note>
167+
144168
### Multiple schemas
145169

146170
If you have multiple separate schemas in the same project you can add the extension multiple times:

docs/guides/frameworks/supabase-authentication.mdx

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -72,29 +72,4 @@ const supabase = createClient<Database>(
7272
// Your task
7373
```
7474
75-
## Using Prisma with Supabase Supavisor (connection pooler)
76-
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.
78-
79-
```ts
80-
// In trigger.config.ts
81-
prismaExtension({
82-
schema: "prisma/schema.prisma",
83-
directUrlEnvVarName: "DATABASE_URL_UNPOOLED",
84-
}),
85-
```
86-
87-
```bash
88-
# Environment variables
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"
93-
```
94-
95-
<Note>
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.
98-
</Note>
99-
10075
<SupabaseDocsCards />

0 commit comments

Comments
 (0)