Skip to content

Commit 87eba65

Browse files
urls deprecated (#7226)
1 parent f8c32d1 commit 87eba65

3 files changed

Lines changed: 23 additions & 5 deletions

File tree

content/200-orm/100-prisma-schema/10-overview/02-data-sources.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ metaDescription: 'Data sources enable Prisma to connect to your database. This p
66

77
A data source determines how Prisma ORM connects to your database, and is represented by the [`datasource`](/orm/reference/prisma-schema-reference#datasource) block in the Prisma schema. The following data source uses the `postgresql` provider and includes a connection URL:
88

9+
::::note
10+
As of Prisma ORM v7, the `url`, `directUrl`, and `shadowDatabaseUrl` fields in the Prisma schema `datasource` block are deprecated. Configure these fields in [Prisma Config](/orm/reference/prisma-config-reference) instead.
11+
::::
12+
913
```prisma
1014
datasource db {
1115
provider = "postgresql"

content/200-orm/500-reference/100-prisma-schema-reference.mdx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,16 @@ A `datasource` block accepts the following fields:
1818
| Name | Required | Type | Description |
1919
| ------------------- | -------- | ------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
2020
| `provider` | **Yes** | String (`postgresql`, `mysql`, `sqlite`, `sqlserver`, `mongodb`, `cockroachdb`) | Describes which data source connectors to use. |
21-
| `url` | **Yes** | String (URL) | Connection URL including authentication info. Most connectors use [the syntax provided by the database](/orm/reference/connection-urls#format). |
22-
| `shadowDatabaseUrl` | No | String (URL) | Connection URL to the shadow database used by Prisma Migrate. Allows you to use a cloud-hosted database as the shadow database. |
23-
| `directUrl` | No | String (URL) | Connection URL for direct connection to the database.<br /><br />If you use a connection pooler URL in the `url` argument (for example, if you use [Prisma Accelerate](/accelerate) or pgBouncer), Prisma CLI commands that require a direct connection to the database use the URL in the `directUrl` argument. <br/> <br/> The `directUrl` property is supported by Prisma Studio from version 5.1.0 upwards. <br/> <br/> The `directUrl` property is not needed when using [Prisma Postgres](/postgres) database. |
21+
| `url` | **Yes** | String (URL) | **Deprecated in Prisma ORM v7.** Configure the connection URL in Prisma Config instead: see [`datasource.url`](/orm/reference/prisma-config-reference#datasourceurl). Existing schemas continue to work, but you should migrate to Prisma Config. |
22+
| `shadowDatabaseUrl` | No | String (URL) | **Deprecated in Prisma ORM v7.** Configure the shadow database URL in Prisma Config instead: see [`datasource.shadowDatabaseUrl`](/orm/reference/prisma-config-reference#datasourceshadowdatabaseurl). |
23+
| `directUrl` | No | String (URL) | **Deprecated in Prisma ORM v7.** Configure the direct connection URL in Prisma Config instead: see [`datasource.directUrl`](/orm/reference/prisma-config-reference#datasourcedirecturl). |
2424
| `relationMode` | No | String (`foreignKeys`, `prisma`) | Sets whether [referential integrity](/orm/prisma-schema/data-model/relations/relation-mode) is enforced by foreign keys in the database or emulated in the Prisma Client.<br /><br />In preview in versions 3.1.1 and later. The field is named `relationMode` in versions 4.5.0 and later, and was previously named `referentialIntegrity`. |
2525
| `extensions` | No | List of strings (PostgreSQL extension names) | Allows you to [represent PostgreSQL extensions in your schema](/orm/prisma-schema/postgresql-extensions). Available in preview for PostgreSQL only in Prisma ORM versions 4.5.0 and later. |
2626

27+
::::note
28+
As of Prisma ORM v7, the `url`, `directUrl`, and `shadowDatabaseUrl` fields in the Prisma schema `datasource` block are deprecated. Configure these fields in [Prisma Config](/orm/reference/prisma-config-reference) instead.
29+
::::
30+
2731
The following providers are available:
2832

2933
- [`sqlite`](/orm/overview/databases/sqlite)

content/200-orm/500-reference/325-prisma-config-reference.mdx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,26 +374,36 @@ export default defineConfig({
374374

375375
Connection URL including authentication info. Most connectors use [the syntax provided by the database](/orm/reference/connection-urls#format).
376376

377+
:::note
378+
Replaces the deprecated `url` field in the Prisma schema `datasource` block (Prisma ORM v7 and later).
379+
:::
380+
377381
| Property | Type | Required | Default |
378382
| -------- | ------------------ | -------- | ----------------- |
379383
| `datasource.url` | `string` | Yes | `''` |
380384

381385

382386
### `datasource.shadowDatabaseUrl`
383387

384-
385388
Connection URL to the shadow database used by Prisma Migrate. Allows you to use a cloud-hosted database as the shadow database
386389

390+
:::note
391+
Replaces the deprecated `shadowDatabaseUrl` field in the Prisma schema `datasource` block (Prisma ORM v7 and later).
392+
:::
393+
387394
| Property | Type | Required | Default |
388395
| -------- | ------------------ | -------- | ----------------- |
389396
| `datasource.shadowDatabaseUrl` | `string` | No | `''` |
390397

391398

392399
### `datasource.directUrl`
393400

394-
395401
Connection URL for direct connection to the database.
396402

403+
:::note
404+
Replaces the deprecated `directUrl` field in the Prisma schema `datasource` block (Prisma ORM v7 and later).
405+
:::
406+
397407
If you use a connection pooler URL in the `url` argument (for example, if you use [Prisma Accelerate](/accelerate) or pgBouncer), Prisma CLI commands that require a direct connection to the database use the URL in the `directUrl` argument. <br/> <br/> The `directUrl` property is supported by Prisma Studio from version 5.1.0 upwards. <br/> <br/> The `directUrl` property is not needed when using [Prisma Postgres](/postgres) database.
398408

399409
| Property | Type | Required | Default |

0 commit comments

Comments
 (0)