Skip to content

Commit 069ca1d

Browse files
author
carlagn
authored
Merge branch 'main' into fix/DC-3193-show-query-results-color
2 parents 3fb7792 + b0167e5 commit 069ca1d

3 files changed

Lines changed: 28 additions & 9 deletions

File tree

content/200-orm/050-overview/500-databases/880-supabase.mdx

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ To learn more about Supabase, you can check out their architecture [here](https:
1818

1919
Many aspects of using Prisma ORM with Supabase are just like using Prisma ORM with any other relational database. You can still:
2020

21-
- model your database with the [Prisma Schema Language](/orm/prisma-schema)
22-
- use Prisma ORM's existing [`postgresql` database connector](/orm/overview/databases/postgresql) in your schema, along with the [connection string Supabase provides you](https://supabase.com/docs/guides/database/connecting-to-postgres#connecting-to-external-libraries-and-tools)
23-
- use [Introspection](/orm/prisma-schema/introspection) for existing projects if you already have a database schema in Supabase
24-
- use [`db push`](/orm/prisma-migrate/workflows/prototyping-your-schema) to push changes in your schema to Supabase
25-
- use [Prisma Client](/orm/prisma-client) in your application to talk to the database server at Supabase
21+
- Model your database with the [Prisma Schema Language](/orm/prisma-schema)
22+
- Use Prisma ORM's existing [`postgresql` database connector](/orm/overview/databases/postgresql) in your schema, along with the [connection string Supabase provides you](https://supabase.com/docs/guides/database/connecting-to-postgres#connecting-to-external-libraries-and-tools)
23+
- Use [Introspection](/orm/prisma-schema/introspection) for existing projects if you already have a database schema in Supabase
24+
- Use [`db push`](/orm/prisma-migrate/workflows/prototyping-your-schema) to push changes in your schema to Supabase
25+
- Use [Prisma Client](/orm/prisma-client) in your application to talk to the database server at Supabase
2626

2727
## Specific considerations
2828

@@ -33,7 +33,19 @@ If you'd like to use the [connection pooling feature](https://supabase.com/docs/
3333
DATABASE_URL="postgres://postgres.[your-supabase-project]:[password]@aws-0-[aws-region].pooler.supabase.com:6543/postgres?pgbouncer=true"
3434
```
3535

36-
If you would like to use the Prisma CLI in order to perform other actions on your database (e.g. migrations) you will need to add a `DIRECT_URL` environment variable to use in the `datasource.directUrl` property so that the CLI can bypass Supavisor:
36+
Supabase provides three types of connection strings for each database:
37+
38+
1. **Direct Database Connection string**`postgresql://postgres:password@db.[your-project-ref].supabase.co:5432/postgres`
39+
40+
2. **Transaction Pooler Connection string**`postgresql://postgres.[your-project-ref]:password@aws-0-[region].pooler.supabase.com:6543/postgres`
41+
42+
3. **Session Pooler Connection string**`postgresql://postgres.[your-project-ref]:password@aws-0-[region].pooler.supabase.com:5432/postgres`
43+
44+
If you would like to use the Prisma CLI in order to perform other actions on your database (e.g. migrations), your setup depends on the connection string used:
45+
46+
- If your `DATABASE_URL` uses the Transaction Pooler (connection string 2), you must provide a `DIRECT_URL` with either the Direct Database (1) or Session Pooler (3) connection string in order for Prisma Migrate to work.
47+
48+
- If your `DATABASE_URL` already uses the Session Pooler (connection string 3), you do not need to provide a `DIRECT_URL`. Prisma Migrate will work without it.
3749

3850
```env file=.env highlight=4-5;add showLineNumbers
3951
# Connect to Supabase via connection pooling with Supavisor.
@@ -42,6 +54,8 @@ DATABASE_URL="postgres://postgres.[your-supabase-project]:[password]@aws-0-[aws-
4254
//add-start
4355
# Direct connection to the database. Used for migrations.
4456
DIRECT_URL="postgres://postgres.[your-supabase-project]:[password]@aws-0-[aws-region].pooler.supabase.com:5432/postgres"
57+
# or
58+
DIRECT_URL="postgresql://postgres:password@db.[your-project-ref].supabase.co:5432/postgres"
4559
//add-end
4660
```
4761

content/250-postgres/1200-more/800-known-limitations.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ Prisma Postgres will be gradually rolled out in new regions.
1919

2020
Prisma Postgres _currently_ has a fixed connection limit of `10` that cannot be adjusted.
2121

22-
### Postgres extensions are not supported
22+
### Limited Postgres extensions support
2323

24-
Prisma Postgres currently lacks support for Postgres extensions. This is a temporary limitation, and we plan to add support soon. Let us know which extensions you need by filling out [this form](https://pris.ly/i-want-extensions).
24+
Prisma Postgres currently supports only the PostgreSQL extensions that come pre-installed with the standard PostgreSQL distribution. We are actively working on expanding support to include a broader range of community maintained extensions. Let us know which ones you'd like us to prioritize by filling out [this form](https://pris.ly/i-want-extensions).

sidebars.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,12 @@ const sidebars: SidebarsConfig = {
440440
label: "Integration Solutions",
441441
collapsed: false,
442442
collapsible: false,
443-
items: ["guides/clerk-nextjs", "guides/shopify", "guides/permit-io-access-control"].sort(),
443+
items: [
444+
"guides/clerk-nextjs",
445+
"guides/shopify",
446+
"guides/permit-io-access-control",
447+
"guides/betterauth-nextjs",
448+
].sort(),
444449
},
445450
{
446451
type: "category",

0 commit comments

Comments
 (0)