Skip to content

Commit fc2b719

Browse files
docs: highlight Prisma 7 driver adapter pool defaults and add v6 parity examples (#7406)
1 parent e16b5c3 commit fc2b719

File tree

5 files changed

+99
-6
lines changed

5 files changed

+99
-6
lines changed

content/200-orm/050-overview/500-databases/300-postgresql.mdx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,15 @@ As an example, if you want to connect to a schema called `myschema`, set the con
160160
postgresql://USER:PASSWORD@HOST:PORT/DATABASE?schema=myschema&connection_limit=5&socket_timeout=3
161161
```
162162

163-
:::tip[Prisma ORM v7 connection pooling]
164-
In Prisma ORM v7, [driver adapters](/orm/overview/databases/database-drivers) are the default for relational databases. Connection pooling is handled by the Node.js driver you provide (like `pg`), not by Prisma's connection URL parameters. See the [connection pool guide](/orm/prisma-client/setup-and-configuration/databases-connections/connection-pool) for v7 defaults and configuration.
163+
:::warning[Prisma ORM v7: Connection pool defaults have changed]
164+
165+
In Prisma ORM v7, [driver adapters](/orm/overview/databases/database-drivers) are the default for relational databases. Connection pooling is now handled by the `pg` driver, which has **different defaults** than Prisma ORM v6:
166+
167+
- **Connection timeout**: `0` (no timeout) vs. v6's `5s`
168+
- **Idle timeout**: `10s` vs. v6's `300s`
169+
170+
If you experience timeout issues after upgrading, you may need to configure your driver adapter to match v6 behavior. See the [connection pool guide](/orm/prisma-client/setup-and-configuration/databases-connections/connection-pool#postgresql-using-the-pg-driver-adapter) for detailed configuration examples.
171+
165172
:::
166173

167174
### Configuring an SSL connection

content/200-orm/050-overview/500-databases/400-mysql.mdx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,15 @@ As an example, if you want to set the connection pool size to `5` and configure
130130
mysql://USER:PASSWORD@HOST:PORT/DATABASE?connection_limit=5&socket_timeout=3
131131
```
132132

133-
:::tip[Prisma ORM v7 connection pooling]
134-
In Prisma ORM v7, [driver adapters](/orm/overview/databases/database-drivers) are the default for relational databases. Connection pooling is handled by the Node.js driver you provide (like `mariadb`), not by Prisma's connection URL parameters. See the [connection pool guide](/orm/prisma-client/setup-and-configuration/databases-connections/connection-pool) for v7 defaults and configuration.
133+
:::warning[Prisma ORM v7: Connection pool defaults have changed]
134+
135+
In Prisma ORM v7, [driver adapters](/orm/overview/databases/database-drivers) are the default for relational databases. Connection pooling is now handled by the `mariadb` driver, which has **different defaults** than Prisma ORM v6:
136+
137+
- **Connection timeout**: `1s` vs. v6's `5s`
138+
- **Idle timeout**: `1800s` vs. v6's `300s`
139+
140+
If you experience timeout issues after upgrading, you may need to configure your driver adapter to match v6 behavior. See the [connection pool guide](/orm/prisma-client/setup-and-configuration/databases-connections/connection-pool#mysql-or-mariadb-using-the-mariadb-driver) for detailed configuration examples.
141+
135142
:::
136143

137144
### Configuring an SSL connection

content/200-orm/050-overview/500-databases/800-sql-server/index.mdx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,15 @@ sqlserver://HOST[:PORT];database=DATABASE;user={MyServer/MyUser};password={ThisI
131131
| `trustServerCertificate` | No | `false` | Configures whether to trust the server certificate. |
132132
| `trustServerCertificateCA` | No | | A path to a certificate authority file to be used instead of the system certificates to authorize the server certificate. Must be either in `pem`, `crt` or `der` format. Cannot be used together with `trustServerCertificate` parameter. |
133133

134-
:::tip[Prisma ORM v7 connection pooling]
135-
In Prisma ORM v7, [driver adapters](/orm/overview/databases/database-drivers) are the default for relational databases. Connection pooling is handled by the Node.js driver you provide (like `mssql`), not by Prisma's connection URL parameters. See the [connection pool guide](/orm/prisma-client/setup-and-configuration/databases-connections/connection-pool) for v7 defaults and configuration.
134+
:::warning[Prisma ORM v7: Connection pool defaults have changed]
135+
136+
In Prisma ORM v7, [driver adapters](/orm/overview/databases/database-drivers) are the default for relational databases. Connection pooling is now handled by the `mssql` driver, which has **different defaults** than Prisma ORM v6:
137+
138+
- **Connection timeout**: `15s` vs. v6's `5s`
139+
- **Idle timeout**: `30s` vs. v6's `300s`
140+
141+
If you experience timeout issues after upgrading, you may need to configure your driver adapter to match v6 behavior. See the [connection pool guide](/orm/prisma-client/setup-and-configuration/databases-connections/connection-pool#sql-server-using-the-mssql-driver) for detailed configuration examples.
142+
136143
:::
137144

138145
### Using [integrated security](https://learn.microsoft.com/en-us/previous-versions/dotnet/framework/data/adonet/sql/authentication-in-sql-server) (Windows only)

content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/115-connection-pool.mdx

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,24 @@ Here are the default connection pool settings for the `pg` driver adapter:
5656
| Idle timeout | `max_idle_connection_lifetime` | `300s` | `idleTimeoutMillis` | `10s` |
5757
| Connection lifetime | `max_connection_lifetime` | `0` (no timeout) | `maxLifetimeSeconds` | `0` (no timeout) |
5858

59+
<details>
60+
<summary>Example: Matching Prisma ORM v6 defaults with the `pg` driver adapter</summary>
61+
62+
If you want to preserve the same timeout behavior you had in Prisma ORM v6, pass the following configuration when instantiating the driver adapter:
63+
64+
```ts
65+
import { PrismaPg } from '@prisma/adapter-pg'
66+
67+
const adapter = new PrismaPg({
68+
connectionString: process.env.DATABASE_URL,
69+
// Match Prisma ORM v6 defaults:
70+
connectionTimeoutMillis: 5_000, // v6 connect_timeout was 5s
71+
idleTimeoutMillis: 300_000, // v6 max_idle_connection_lifetime was 300s
72+
})
73+
```
74+
75+
</details>
76+
5977
:::tip
6078
See the [node-postgres pool documentation](https://node-postgres.com/apis/pool) for details on every available option.
6179
:::
@@ -71,6 +89,28 @@ Here are the default connection pool settings for the `mariadb` driver adapter:
7189
| Connection timeout | `connect_timeout` | `5s` | `connectTimeout` | `1s` |
7290
| Idle timeout | `max_idle_connection_lifetime` | `300s` | `idleTimeout` | `1800s` |
7391

92+
<details>
93+
<summary>Example: Matching Prisma ORM v6 defaults with the `mariadb` driver adapter</summary>
94+
95+
If you want to preserve the same timeout behavior you had in Prisma ORM v6, pass the following configuration when instantiating the driver adapter:
96+
97+
```ts
98+
import { PrismaMariaDb } from '@prisma/adapter-mariadb'
99+
100+
const adapter = new PrismaMariaDb({
101+
host: 'localhost',
102+
port: 3306,
103+
user: process.env.DB_USER,
104+
password: process.env.DB_PASSWORD,
105+
database: process.env.DB_NAME,
106+
// Match Prisma ORM v6 defaults:
107+
connectTimeout: 5_000, // v6 connect_timeout was 5s
108+
idleTimeout: 300, // v6 max_idle_connection_lifetime was 300s (note: in seconds, not ms)
109+
})
110+
```
111+
112+
</details>
113+
74114
:::tip
75115
Refer to the [MariaDB Connector/Node.js pool options](https://mariadb.com/docs/connectors/mariadb-connector-nodejs/connector-nodejs-promise-api#pool-options) for configuration and tuning guidance.
76116
:::
@@ -85,6 +125,30 @@ Here are the default connection pool settings for the `mssql` driver adapter:
85125
| Connection timeout | `connect_timeout` | `5s` | `connectionTimeout` | `15s` |
86126
| Idle timeout | `max_idle_connection_lifetime` | `300s` | `pool.idleTimeoutMillis` | `30s` |
87127

128+
<details>
129+
<summary>Example: Matching Prisma ORM v6 defaults with the `mssql` driver adapter</summary>
130+
131+
If you want to preserve the same timeout behavior you had in Prisma ORM v6, pass the following configuration when instantiating the driver adapter:
132+
133+
```ts
134+
import { PrismaMssql } from '@prisma/adapter-mssql'
135+
136+
const adapter = new PrismaMssql({
137+
server: 'localhost',
138+
port: 1433,
139+
database: 'mydb',
140+
user: process.env.DB_USER,
141+
password: process.env.DB_PASSWORD,
142+
// Match Prisma ORM v6 defaults:
143+
connectionTimeout: 5_000, // v6 connect_timeout was 5s
144+
pool: {
145+
idleTimeoutMillis: 300_000, // v6 max_idle_connection_lifetime was 300s
146+
},
147+
})
148+
```
149+
150+
</details>
151+
88152
:::tip
89153
See the [`node-mssql` pool docs](https://tediousjs.github.io/node-mssql/#general-same-for-all-drivers) for details on these fields.
90154
:::

content/200-orm/800-more/300-upgrade-guides/200-upgrading-versions/400-upgrading-to-prisma-7.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,14 @@ This change aligns with the move to make the main Prisma Client as lean and open
175175
instance, if you are using Prisma Postgres, you now need the `@prisma/adapter-pg` adapter. This also
176176
means the signature for creating a new Prisma Client has changed slightly:
177177

178+
:::warning[Connection pool defaults have changed]
179+
180+
Driver adapters use the connection pool settings from the underlying Node.js database driver, which may differ significantly from Prisma ORM v6 defaults. For example, the `pg` driver has no connection timeout by default (`0`), while Prisma ORM v6 used a 5-second timeout.
181+
182+
**If you experience timeout issues after upgrading**, configure your driver adapter to match v6 behavior. See the [connection pool guide](/orm/prisma-client/setup-and-configuration/databases-connections/connection-pool#prisma-orm-v7-driver-adapter-defaults) for detailed configuration examples for each database.
183+
184+
:::
185+
178186
#### Before
179187

180188
```ts

0 commit comments

Comments
 (0)