Skip to content

Commit 3ff6b4e

Browse files
authored
Merge branch 'main' into feat/DC-4631-dropdown-toc
2 parents d9de779 + 6e65f10 commit 3ff6b4e

File tree

15 files changed

+374
-193
lines changed

15 files changed

+374
-193
lines changed

content/200-orm/100-prisma-schema/20-data-model/65-externally-managed-tables.mdx

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,31 @@ Relationships from an external table to a managed table, where the external tabl
115115

116116
## Example
117117

118-
Assume you have the following tables in a PostgreSQL database in the default `public` schema:
118+
Assume you have the following Prisma schema which only contains the `posts` table:
119+
120+
```prisma
121+
generator client {
122+
provider = "prisma-client-js"
123+
// ...
124+
}
125+
126+
datasource db {
127+
provider = "postgresql"
128+
// ...
129+
}
130+
131+
model posts {
132+
id Int @id @default(autoincrement())
133+
created_at DateTime @default(now())
134+
title String
135+
content String?
136+
}
137+
```
138+
139+
You have created that `posts` table already via a prior migration.
140+
You now also have a `users` table and `role` enum in your database which you want to treat as externally managed.
141+
142+
So the tables in your PostgreSQL database in the default `public` schema look like this:
119143

120144
```sql
121145
-- Enum used by users table
@@ -126,7 +150,7 @@ CREATE TABLE users (
126150
id SERIAL PRIMARY KEY,
127151
username VARCHAR(50) NOT NULL UNIQUE,
128152
email VARCHAR(100) NOT NULL UNIQUE,
129-
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
153+
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
130154
role role
131155
);
132156

@@ -139,17 +163,6 @@ CREATE TABLE posts (
139163
);
140164
```
141165

142-
The Prisma schema only contains the `posts` table at this point:
143-
144-
```prisma
145-
model posts {
146-
id Int @id @default(autoincrement())
147-
created_at DateTime @default(now())
148-
title String
149-
content String?
150-
}
151-
```
152-
153166
### 1. Declaring externally managed tables in Prisma Config
154167

155168
Enable use of externally managed tables via the `tables.external` property:
@@ -242,7 +255,7 @@ model posts {
242255
title String @db.VarChar(200)
243256
content String?
244257
// add-start
245-
author user @relation(fields: [authorId], references: [id])
258+
author users @relation(fields: [author_id], references: [id])
246259
author_id Int
247260
// add-end
248261
}
@@ -254,7 +267,7 @@ model users {
254267
created_at DateTime? @default(now()) @db.Timestamp(6)
255268
role role
256269
// add-start
257-
posts Post[]
270+
posts posts[]
258271
// add-end
259272
}
260273

content/250-postgres/100-introduction/250-overview.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Spend limits are available on the Pro plan and higher. Please note that the spen
3535

3636
### Restarting your database when changing your subscription
3737

38-
When changing your subscription from Starter to Pro/Business or from Pro/Business to Start, your database instance is being restarted. This may cause a downtime of ~1second.
38+
When changing your subscription from Free to Starter/Pro/Business or from Starter/Pro/Business to Free, your database instance is being restarted. This may cause a downtime of ~1second.
3939

4040
:::note
4141
This is temporary. In the future, there won't be any downtime when up- or downgrading a plan.

content/250-postgres/1200-more/1000-faq.mdx

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ We will use the following equations to estimate the monthly bill:
161161

162162
```
163163
total_ops = MAUs x actions_per_user_per_day x 30
164-
billable_ops = total_ops - 100_000
164+
billable_ops = total_ops - included_ops_for_plan
165165
ops_cost = (billable_ops ÷ 1_000_000) x plan_rate
166166
167167
billable_storage_GB = storage_used_GB - free_storage_for_plan
@@ -176,23 +176,26 @@ You can use your own MAU count, activity level, and storage used to project cost
176176

177177
:::
178178

179-
We will associate each workload with a plan and its corresponding pricing details, for example, the **Starter plan** for the small workload, the **Pro plan** for the medium workload, and the **Business Annual plan** for the large workload. Then we will apply the equations to the example workloads to generate a rough estimate of a monthly bill. For example:
179+
We will associate each workload with a paid plan and its corresponding pricing details, for example, the **Starter plan** for the small workload, the **Pro plan** for the medium workload, and the **Business plan** for the large workload. Then we will apply the equations to the example workloads to generate a rough estimate of a monthly bill. For example:
180180

181181
:::note[Pricing details]
182182

183183
Here are the details for each pricing plan:
184184

185-
- **Starter plan** - \$18 per million operations
186-
- Base plan fee - \$0 per month
187-
- Storage - 1 GB free then \$2 per additional GB
188-
- **Pro plan** - \$8 per million operations
185+
- **Starter plan** - \$8 per million operations
186+
- Base plan fee - \$10 per month
187+
- Included operations - 1,000,000
188+
- Storage - 10 GB free then \$2 per additional GB
189+
- **Pro plan** - \$2 per million operations
189190
- Base plan fee - \$49.00 per month
190-
- Storage - 5 GB free then \$1.5 per additional GB
191-
- **Business Annual plan** - \$4 per million operations in the 50-100M/month usage bracket
191+
- Included operations - 10,000,000
192+
- Storage - 50 GB free then \$1.5 per additional GB
193+
- **Business plan** - \$1 per million operations
192194
- Base plan fee - \$129.00 per month
193-
- Storage - 10 GB free then \$1 per additional GB
195+
- Included operations - 50,000,000
196+
- Storage - 100 GB free then \$1 per additional GB
194197

195-
You can also learn more about the pricing details for each plan on the [pricing page](https://www.prisma.io/pricing?utm_source=docs).
198+
We also have a Free plan, but we are leaving it out in the following calculations because it's intended for evaluation only and is not meant for production workloads. You can also learn more about the pricing details for each plan on the [pricing page](https://www.prisma.io/pricing?utm_source=docs).
196199

197200
:::
198201

@@ -201,36 +204,36 @@ You can also learn more about the pricing details for each plan on the [pricing
201204
A hobby or early-stage side-project with ~`500` MAUs. Each user performs ~`10` actions per day, and the entire database uses ~`0.5` GB of storage. Based on the assumptions, you would calculate the monthly bill using the following equations:
202205

203206
- `total_ops` = `500` x `10` x `30` = `150000`
204-
- `billable_ops` = `50000`
205-
- `ops_cost` = (`50000` ÷ `1000000`) x $`18` = $`0.90`
206-
- `storage_cost` = $`0` (0.5 GB is below the 1 GB free tier)
207-
- `base_plan_fee` = $`0`
207+
- `billable_ops` = `0` (150,000 operations is below the 1 million free operations)
208+
- `ops_cost` = $`0`
209+
- `storage_cost` = $`0` (0.5 GB is below the 10 GB storage already included)
210+
- `base_plan_fee` = $`10`
208211

209-
`total_monthly_cost` = $`0.90` per month
212+
`total_monthly_cost` = $`10.00` per month
210213

211214
**Example of a medium workload on the Pro plan**:
212215

213216
A growing SaaS product serving ~`5000` MAUs. Power users average ~`40` actions per day, and the app stores ~`6` GB of data. Based on the assumptions, you would calculate the monthly bill using the following equations:
214217

215218
- `total_ops` = `5000` x `40` x `30` = `6000000`
216-
- `billable_ops` = `5900000`
217-
- `ops_cost` = (`5900000` ÷ `1000000`) = `5.9` x $`8` = $`47.20`
218-
- `storage_cost` = (`6` GB - `5` GB) x $`1.50` = $`1.50`
219+
- `billable_ops` = `0` (6 million operations is below the 10 million free operations)
220+
- `ops_cost` = $`0`
221+
- `storage_cost` = $`0` (6 GB is below the 50 GB storage already included)
219222
- `base_plan_fee` = $`49.00`
220223

221-
`total_monthly_cost` = $`47.20` + $`1.50` + $`49.00` = $`97.70` per month
224+
`total_monthly_cost` = $`49.00` per month
222225

223-
**Example of a large workload on the Business Annual plan**:
226+
**Example of a large workload on the Business plan**:
224227

225228
A production-grade, consumer-facing application handling ~`50000` MAUs. Heavy usage with ~`60` actions per user per day drives significant traffic, and the dataset reaches ~`40` GB. Based on the assumptions, you would calculate the monthly bill using the following equations:
226229

227230
- `total_ops` = `50000` x `60` x `30` = `90000000`
228-
- `billable_ops` = `89900000`
229-
- `ops_cost` = (`89900000` ÷ `1000000`) = `89.9` x $`4` = $`359.6`
230-
- `storage_cost` = (`40` GB - `10` GB) x $`1` = $`30.00`
231+
- `billable_ops` = `90000000` - `50000000` = `40000000`
232+
- `ops_cost` = (`40000000` ÷ `1000000`) = `40.00` x $`1` = $`40.00`
233+
- `storage_cost` = $`0.00` (40 GB is below the 100 GB storage already included)
231234
- `base_plan_fee` = $`129.00`
232235

233-
`total_monthly_cost` = $`359.6` + $`30.00` + $`129.00` = $`518.60` per month
236+
`total_monthly_cost` = $`40.00` + $`129.00` = $`169.00` per month
234237

235238
### Are cached operations billed the same?
236239

@@ -330,11 +333,11 @@ Using on-demand cache invalidation in these scenarios helps keep only the necess
330333

331334
Yes, you can increase your Prisma Postgres limits based on your subscription plan. Here are the configurable limits:
332335

333-
| Limit | Starter | Pro Plan | Business Plan |
334-
|--------------------------------|-------------------|-------------------|-------------------|
335-
| **Query timeout** | Up to 10 seconds | Up to 20 seconds | Up to 60 seconds |
336-
| **Interactive transactions timeout** | Up to 15 seconds | Up to 30 seconds | Up to 90 seconds |
337-
| **Response size** | Up to 5 MB | Up to 10 MB | Up to 20 MB |
336+
| Limit | Free | Starter | Pro Plan | Business Plan |
337+
|--------------------------------------|------------------|-------------------|-------------------|-------------------|
338+
| **Query timeout** | Up to 10 seconds | Up to 10 seconds | Up to 20 seconds | Up to 60 seconds |
339+
| **Interactive transactions timeout** | Up to 15 seconds | Up to 15 seconds | Up to 30 seconds | Up to 90 seconds |
340+
| **Response size** | Up to 5 MB | Up to 5 MB | Up to 10 MB | Up to 20 MB |
338341

339342
Check the [pricing page](https://www.prisma.io/pricing) for more details on the available plans and their corresponding limits.
340343

content/250-postgres/300-database/400-connection-pooling.mdx

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Currently, Prisma Postgres allows a maximum of 10 concurrent database connection
2525

2626
If you're using **your own database** with Prisma Accelerate, the connection limits differ:
2727

28+
- **Free plan**: Maximum of `10` connections.
2829
- **Starter plan**: Maximum of `10` connections. This is often sufficient for most workloads, but if you're expecting high traffic or intensive compute operations, you may want to [increase this limit](#configuring-the-connection-pool-size).
2930
- **Pro plan**: Supports up to `100` concurrent connections.
3031
- **Business plan**: Supports up to `1000` concurrent connections.
@@ -68,9 +69,9 @@ You can configure the minimum and maximum query response size, query duration, a
6869

6970
Prisma Postgres has a default global timeout of `10s` for each query, configurable using the slider labeled **Query duration**, based on your subscription plan:
7071

71-
| Plan | Starter | Pro | Business |
72-
|----------|---------------|--------------|---------------|
73-
| Query timeout | Up to `10` seconds | Up to `20` seconds | Up to `60` seconds |
72+
| Plan | Free | Starter | Pro | Business |
73+
|---------------|-----------------|-----------------|----------------|-----------------|
74+
| Query timeout | Up to `10` seconds | Up to `10` seconds | Up to `20` seconds | Up to `60` seconds |
7475

7576
See the [error reference](/postgres/database/error-reference#p6004-querytimeout) and our [pricing page](https://www.prisma.io/pricing) for more information.
7677

@@ -83,9 +84,9 @@ While you can increase the query timeout, it's recommended to inspect and optimi
8384

8485
Prisma Postgres has a default global timeout of `15s` for each [interactive transaction](/orm/prisma-client/queries/transactions#interactive-transactions), configurable using the slider labeled **Transaction duration**, based on your subscription plan:
8586

86-
| Plan | Starter | Pro | Business |
87-
|----------------------------|---------------|--------------|---------------|
88-
| Interactive transaction limit | Up to `15` seconds | Up to `30` seconds | Up to `90` seconds |
87+
| Plan | Free | Starter | Pro | Business |
88+
|-------------------------------|----------------|---------------|--------------|---------------|
89+
| Interactive transaction limit | Up to `15` seconds | Up to `15` seconds | Up to `30` seconds | Up to `90` seconds |
8990

9091
See the [error reference](/postgres/database/error-reference#p6004-querytimeout) and our [pricing page](https://www.prisma.io/pricing#accelerate) for more information.
9192

@@ -112,9 +113,9 @@ While you can increase the interactive transaction timeout limit, it's recommend
112113

113114
Prisma Postgres has a default global response size limit of `5MB`, configurable using the slider labeled **Response size**, based on your subscription plan:
114115

115-
| Plan | Starter | Pro | Business |
116-
|----------|---------------|--------------|---------------|
117-
| Query size | Up to `5MB` | Up to `10MB` | Up to `20MB` |
116+
| Plan | Free | Starter | Pro | Business |
117+
|------------|--------------|---------------|--------------|---------------|
118+
| Query size | Up to `5MB` | Up to `5MB` | Up to `10MB` | Up to `20MB` |
118119

119120
See the [error reference](/postgres/database/error-reference#p6009-responsesizelimitexceeded) and our [pricing page](https://www.prisma.io/pricing#accelerate) for more information.
120121

@@ -143,13 +144,14 @@ This distributed model allows your application to handle increased traffic by sp
143144

144145
### Enabling Autoscaling
145146

146-
Autoscaling is automatically enabled **when your Accelerate connection limit is set above the default (10)**. This feature is **not available on the Starter plan**.
147+
Autoscaling is automatically enabled **when your Accelerate connection limit is set above the default (10)**. This feature is **not available on the Free or Starter plan**.
147148

148149
Your environment's maximum connection limit is based on your [Prisma Data Platform plan](https://www.prisma.io/pricing):
149150

150151
| Plan | Max Connection Limit |
151152
|-------------|--------------------------------------|
152-
| Starter | `10` |
153-
| Pro | `100` |
154-
| Business | `1000` |
153+
| Free | `10` |
154+
| Starter | `10` |
155+
| Pro | `100` |
156+
| Business | `1000` |
155157
| Enterprise | [Contact Us](mailto:sales@prisma.io) |

content/250-postgres/300-database/525-postgres-extensions.mdx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ sidebar_class_name: early-access-badge
1212
Prisma Postgres supports the following [PostgreSQL extensions](https://www.postgresql.org/docs/current/sql-createextension.html):
1313

1414
- [`pgvector`](https://github.com/pgvector/pgvector)
15+
- [`pg_stat_statements`](https://www.postgresql.org/docs/current/pgstatstatements.html)
16+
- [`citext`](https://www.postgresql.org/docs/current/citext.html)
17+
- [`pg_trgm`](https://www.postgresql.org/docs/current/pgtrgm.html)
18+
- [`fuzzystrmatch`](https://www.postgresql.org/docs/current/fuzzystrmatch.html)
19+
- [`unaccent`](https://www.postgresql.org/docs/current/unaccent.html)
20+
- [`pg_search`](https://pgxn.org/dist/pg_search)
1521

1622
Support for [more extensions](#other-extensions-are-coming-soon) will follow soon. If there are specific extensions you'd like to see in Prisma Postgres, [fill out this form](https://pris.ly/i-want-extensions).
1723

@@ -161,7 +167,6 @@ Support for the following extensions is going to come soon:
161167

162168
- [`pgcrypto`](https://www.postgresql.org/docs/current/pgcrypto.html)
163169
- [`postgis`](https://postgis.net/)
164-
- [`pg_search`](https://www.paradedb.com/blog/introducing_search)
165170
- [`contrib`](https://www.postgresql.org/docs/current/contrib.html) extensions
166171

167172
If there are specific extensions you'd like to see, [fill out this form](https://pris.ly/i-want-extensions).

content/250-postgres/300-database/650-direct-connections.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,18 @@ Prisma Postgres closes idle connections after an extended period of time. If tha
5858

5959
While direct connections are in Early Access, the following connection limits apply:
6060

61-
| | Starter (Free) | Pro | Business |
62-
| ------------------------------------ | ---------------- | ---------------- | ---------------- |
63-
| **Connection limit** | Max 20 | Max 20 | Max 20 |
61+
| | Free | Starter | Pro | Business |
62+
| ------------------------------------ | ---------------- | ---------------- | ---------------- | ---------------- |
63+
| **Connection limit** | Max 10 | Max 10 | Max 50 | Max 100 |
6464

6565
### Query and transaction timeouts
6666

6767
While direct connections are in Early Access, the following timeouts apply:
6868

69-
| | Starter (Free) | Pro | Business |
70-
| ------------------------------------ | ---------------- | ---------------- | ---------------- |
71-
| **Query timeout** | Up to 10 seconds | Up to 10 seconds | Up to 10 seconds |
72-
| **Interactive transactions timeout** | Up to 15 seconds | Up to 15 seconds | Up to 15 seconds |
69+
| | Free | Starter | Pro | Business |
70+
| ------------------------------------ | ---------------- | ---------------- | ---------------- | ---------------- |
71+
| **Query timeout** | Up to 10 seconds | Up to 10 seconds | Up to 10 seconds | Up to 10 seconds |
72+
| **Interactive transactions timeout** | Up to 15 seconds | Up to 15 seconds | Up to 15 seconds | Up to 15 seconds |
7373

7474
### Limited user permissions
7575

content/300-accelerate/600-faq.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,11 @@ If you don't need [interactive transactions](/orm/prisma-client/queries/transact
157157

158158
Yes, you can increase your Accelerate limits based on your subscription plan. Here are the configurable limits:
159159

160-
| Limit | Starter | Pro Plan | Business Plan |
161-
| ------------------------------------ | ---------------- | ---------------- | ---------------- |
162-
| **Query timeout** | Up to 10 seconds | Up to 20 seconds | Up to 60 seconds |
163-
| **Interactive transactions timeout** | Up to 15 seconds | Up to 30 seconds | Up to 90 seconds |
164-
| **Response size** | Up to 5 MB | Up to 10 MB | Up to 20 MB |
160+
| Limit | Free | Starter | Pro Plan | Business Plan |
161+
| ------------------------------------ | ---------------- | ---------------- | ---------------- | ---------------- |
162+
| **Query timeout** | Up to 10 seconds | Up to 10 seconds | Up to 20 seconds | Up to 60 seconds |
163+
| **Interactive transactions timeout** | Up to 15 seconds | Up to 15 seconds | Up to 30 seconds | Up to 90 seconds |
164+
| **Response size** | Up to 5 MB | Up to 5 MB | Up to 10 MB | Up to 20 MB |
165165

166166
Check the [pricing page](https://www.prisma.io/pricing#accelerate) for more details on the available plans and their corresponding limits.
167167

content/500-platform/10-about.mdx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,11 @@ The **Database** tab in the left panel of a project environment lets you configu
110110

111111
## Billing
112112

113-
The [subscription plan](https://www.prisma.io/pricing?utm_source=docs&utm_medium=platform-docs) you select in your workspace determines how many projects and environments you can create in that workspace:
113+
The [subscription plan](https://www.prisma.io/pricing?utm_source=docs&utm_medium=platform-docs) you select in your workspace determines how many databases you can create in that workspace:
114114

115-
| | **Starter** | **Pro** | **Business** | **Enterprise** |
116-
| ---------------- | :---------- | ----------- | ------------ | -------------- |
117-
| **Projects** | 5 | 60 | 180 | Custom |
118-
| **Environments** | 2 / project | 6 / project | 12 / project | Custom |
119-
| **Databases** | 10 | 60 | 180 | Custom |
115+
| | **Free** | **Starter** | **Pro** | **Business** | **Enterprise** |
116+
| ---------------- | ----------- | ----------- | ----------- | ------------ | -------------- |
117+
| **Databases** | 5 | 10 | 100 | 1000 | Custom |
120118

121119
### Per-workspace billing
122120

content/800-guides/210-shopify.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,4 +671,4 @@ Now that you have a working Shopify app connected to a Prisma Postgres database,
671671
### More Info
672672
673673
- [Prisma Documentation](/orm/overview/introduction)
674-
- [Shopify Dev Documentation](https://shopify.dev/docs/)
674+
- [Shopify Dev Documentation](https://shopify.dev/docs)

0 commit comments

Comments
 (0)