Skip to content

Commit 3d11b9f

Browse files
committed
docs(ppg): updates
1 parent d6dc975 commit 3d11b9f

7 files changed

Lines changed: 23 additions & 91 deletions

File tree

content/250-postgres/100-introduction/220-npx-create-db.mdx

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -96,37 +96,28 @@ Here is an example output:
9696
┌ 🚀 Creating a Prisma Postgres database
9797
9898
│ Provisioning a temporary database in us-east-1...
99-
10099
│ It will be automatically deleted in 24 hours, but you can claim it.
101-
102100
◇ Database created successfully!
103101
104-
● Connect to your database →
105-
106-
│ Use this connection string optimized for Prisma ORM:
107-
│ prisma+postgres://accelerate.prisma-data.net/?api_key=...
108-
109-
│ Use this connection string for everything else:
102+
● Database Connection
103+
│ Connection String:
110104
│ postgresql://<username>:<password>@db.prisma.io:5432/postgres
111105
112106
◆ Claim your database →
113-
114-
│ Want to keep your database? Claim for free:
107+
│ Keep your database for free:
115108
│ https://create-db.prisma.io?projectID=proj_...
116109
117110
```
118111

119112

120-
Once you have the output, take the **Prisma ORM-optimized connection string** (`prisma+postgres://...`) and add it to your `.env` file as `DATABASE_URL`:
113+
Once you have the output, take the connection string and add it to your `.env` file as `DATABASE_URL`:
121114

122115
```env
123-
DATABASE_URL="prisma+postgres://accelerate.prisma-data.net/?api_key=..."
116+
DATABASE_URL="postgresql://<username>:<password>@db.prisma.io:5432/postgres"
124117
```
125118

126119
You can now follow the [Prisma Postgres quickstart guide](/getting-started/prisma-orm/quickstart/prisma-postgres) to connect your Prisma project to this database.
127120

128-
If you're using other tools or libraries, use the **standard PostgreSQL connection string** (`postgresql://...`) with any PostgreSQL-compatible client, such as `psql`, `pgAdmin`, `node-postgres`, or an ORM of your choice. Detailed instructions are available in the guide for [connecting via direct PostgreSQL connection string](/postgres/database/direct-connections).
129-
130121

131122
## Claiming your database
132123

@@ -163,12 +154,12 @@ When you claim a database:
163154

164155
Here are the CLI flags for the `npx create-db` command:
165156

166-
| Flag | Shorthand | Description |
167-
|---------------|-----------|----------------------------------------------------------------------------------------------|
168-
| `--region` | `-r` | Specify a region. <br /> **Available regions:** `ap-southeast-1`, `ap-northeast-1`, `eu-central-1`, `eu-west-3`, `us-east-1`, `us-west-1` |
169-
| `--interactive` | `-i` | Run in interactive mode (select region from a list). |
170-
| `--json` | `-j` | Output machine-readable JSON and exit. |
171-
| `--help` | `-h` | Show this help message. |
157+
| Flag | Shorthand | Description |
158+
|-----------------|-----------|-------------------------------------------------------------------------------------------------------------------------------------------|
159+
| `--region` | `-r` | Specify a region. <br /> **Available regions:** `ap-southeast-1`, `ap-northeast-1`, `eu-central-1`, `eu-west-3`, `us-east-1`, `us-west-1` |
160+
| `--interactive` | `-i` | Run in interactive mode (select region from a list). |
161+
| `--json` | `-j` | Output machine-readable JSON and exit. |
162+
| `--help` | `-h` | Show this help message. |
172163

173164

174165
To view all CLI options use the `--help` or `-h` flag:

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,8 @@ If you previously signed up using GitHub and want to switch to email and passwor
2929
3. Test Your Login
3030
- Log out and try logging in with your email and the password you just created.
3131

32-
:::note
33-
3432
If you encounter any issues, please contact our support team for help linking your accounts.
3533

36-
:::
3734

3835
### VS Code does not recognize the `$extends` method
3936

content/250-postgres/1200-more/900-troubleshooting.mdx

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -33,28 +33,6 @@ npx prisma@latest init --db
3333

3434
This ensures that you're using the most up-to-date CLI, preventing issues with outdated command syntax.
3535

36-
## Warning: In production, we recommend using `prisma generate --no-engine`
37-
38-
### Problem
39-
40-
You're seeing the following error in your logs:
41-
42-
```
43-
prisma:warn: In production, we recommend using 'prisma generate --no-engine'
44-
```
45-
46-
### Cause
47-
48-
Prisma ORM by default uses a [query engine](/orm/overview/) binary that's deployed as part of the `@prisma/client` package. However, with Prisma Postgres, this is not needed.
49-
50-
### Solution
51-
52-
To remove this warning and generate Prisma Client without the query engine, you can run the following command:
53-
54-
```
55-
npx prisma generate --no-engine
56-
```
57-
5836
## Workspace plan limit reached when running `prisma init --db`
5937

6038
### Problem

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

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,13 @@ For Prisma Postgres, the connection limit depends on the plan you have signed up
1818
|---------------------------|------|---------|-----|----------|
1919
| Connection Limit (Pooled) | 10 | 100 | 500 | 1000 |
2020

21-
:::note
22-
For the **Starter plan**, 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).
23-
:::
24-
2521
You can compare plans on the [Prisma pricing page](https://www.prisma.io/pricing).
2622

2723

28-
### Configuring the connection pool size
29-
30-
For Prisma Postgres, the connection limit is managed automatically for you.
31-
32-
If you're **not using Prisma Postgres**, you can configure the connection pool size for Prisma ORM by specifying it [in the connection string](/orm/prisma-client/setup-and-configuration/databases-connections/connection-pool#setting-the-connection-pool-size).
33-
34-
If you're using Prisma Accelerate with your own database, you can configure the connection pool size through the `Connection limit` setting in your project on the [Accelerate setup page](/accelerate/getting-started).
35-
36-
### Configuring the connection pool timeout
24+
### Connection pool timeout
3725

3826
The connection pool timeout is the maximum number of seconds that a query will block while waiting for a connection from Prisma Postgres's internal connection pool. This occurs if the number of concurrent requests exceeds the connection limit, resulting in queueing of additional requests until a free connection becomes available. An exception is thrown if a free connection does not become available within the pool timeout. The connection pool timeout can be disabled by setting the value to 0.
3927

40-
Similar to the connection pool size, you may also configure the connection pool timeout via the _database connection string_. To adjust this value, you may add the `pool_timeout` parameter to the database connection string.
4128

4229
For example:
4330

content/250-postgres/300-database/550-local-development.mdx

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,13 @@ sidebar_class_name: preview-badge
1010

1111
[Prisma Postgres](/postgres) is a production-grade, cloud-native database and is ideal for staging and production environments. For rapid iteration and isolated testing, you can run a _local_ Prisma Postgres instance (powered by [PGlite](https://pglite.dev)) via the `prisma dev` command. This page explains how to install and launch a local Prisma Postgres database.
1212

13-
:::note
14-
1513
Local Prisma Postgres is in [Preview](/orm/more/releases#preview) and is being actively developed.
1614

17-
:::
18-
1915
## Setting up local development for Prisma Postgres
2016

2117
Follow these steps to set up local Prisma Postgres for development.
2218

23-
:::note
24-
Please ensure you're running Node.js 20 or later, as it's required for local Prisma Postgres.
25-
:::
19+
Node.js v20 or later is required for local Prisma Postgres
2620

2721
### 1. Launching local Prisma Postgres
2822

@@ -56,16 +50,6 @@ If you want to connect via Prisma ORM, hit <kbd>h</kbd> on your keyboard, copy t
5650
DATABASE_URL="prisma+postgres://localhost:51213/?api_key=__API_KEY__"
5751
```
5852

59-
The `DATABASE_URL` is a connection string that Prisma uses to connect to the local Prisma Postgres server and is compatible with the [Prisma Postgres extension](https://www.npmjs.com/package/@prisma/extension-accelerate):
60-
61-
```ts
62-
import { withAccelerate } from '@prisma/extension-accelerate'
63-
64-
const prisma = new PrismaClient().$extends(withAccelerate())
65-
```
66-
67-
This ensures no additional code changes are needed when switching from local Prisma Postgres to Prisma Postgres in production.
68-
6953
Keep the local Prisma Postgres server running in the background while you work on your application.
7054

7155
### 2. Applying migrations and seeding data

content/250-postgres/300-database/750-serverless-driver.mdx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ sidebar_class_name: early-access-badge
99

1010
The serverless driver for Prisma Postgres is a lightweight and minimal client library that can talk to Prisma Postgres using raw SQL. You can use it via the [`@prisma/ppg`](https://github.com/prisma/ppg-client/tree/main) npm package.
1111

12+
:::warning
13+
14+
The Prisma Postgres serverless driver is currently in [Early Access](/orm/more/releases#early-access) and not yet recommended for production scenarios.
15+
16+
:::
17+
1218
## Installation
1319

1420
Install the serverless driver via npm:
@@ -32,7 +38,7 @@ type Post = {
3238
authorId: number | null;
3339
}
3440

35-
const sql = ppg(YOUR_DATABASE_URL);
41+
const sql = ppg("prisma+postgres://accelerate.prisma-data.net/?api_key=...");
3642

3743
const authorId = 1;
3844
const posts = await sql<Post>`SELECT * FROM "Post" WHERE "authorId" = ${authorId}`;
@@ -97,7 +103,7 @@ type User = {
97103
email: string
98104
}
99105

100-
const sql = ppg(YOUR_DATABASE_URL);
106+
const sql = ppg("prisma+postgres://accelerate.prisma-data.net/?api_key=...");
101107

102108
const posts: Post[] = await sql<Post>`SELECT * FROM "Post"`
103109

@@ -132,7 +138,7 @@ The `query` function it exposes:
132138
import { Client } from "@prisma/ppg";
133139

134140
const client = new Client({
135-
connectionString: YOUR_DATABASE_URL,
141+
connectionString: "prisma+postgres://accelerate.prisma-data.net/?api_key=...",
136142
});
137143

138144
const posts = await client.query('SELECT * FROM "Post" WHERE "authorId" = $1', [1]);

content/250-postgres/50-getting-started/index.mdx

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,13 @@ npx prisma init --db
1616

1717
After running this command, the terminal will guide you with next steps. Follow [this page](/getting-started/prisma-postgres/from-the-cli) to complete the setup for your first Prisma Postgres project.
1818

19-
:::note
2019
If you need a database quickly for testing, or want to try out Prisma Postgres, you can run the following command to spin up a temporary 24-hour database:
2120

2221
```terminal
2322
npx create-db@latest
2423
```
2524

2625
You can learn more about `npx create-db` in [the dedicated documentation](/postgres/introduction/npx-create-db).
27-
:::
2826

2927
## Prisma ORM
3028

@@ -40,16 +38,7 @@ If you are looking to explore Prisma Postgres in a fullstack project, check out
4038

4139
## Connect via any database library / tool
4240

43-
You can access Prisma Postgres with any ORM or database tool of your choice via [direct TCP connections](/postgres/database/direct-connections).
44-
45-
In order to get a direct TCP connection string, you need to:
46-
1. Navigate to your active Prisma Postgres instance.
47-
1. Click the **API Keys** tab in the project's sidenav.
48-
1. Click the **Create API key** button.
49-
1. In the popup, provide a **Name** for the API key and click **Create**.
50-
1. Copy the connection string starting with `postgres://`, this is your direct connection string.
51-
52-
Once you have the connection string, you can follow the setup docs for PostgreSQL of any ORM or database tool:
41+
You can access Prisma Postgres with any ORM or database tool of your choice. Once you have the connection string, you can follow the setup docs for PostgreSQL of any ORM or database tool:
5342

5443
- [Drizzle ORM](https://orm.drizzle.team/docs/get-started/postgresql-new)
5544
- [Kysely](https://kysely.dev/docs/getting-started)

0 commit comments

Comments
 (0)