Skip to content

Commit 9b8e91b

Browse files
ankur-archaidankmcalister
authored andcommitted
DC-6174: Remove adapter, engine, directUrl, studio from config (#7256)
* feat: add new features * fix: revert links * fix: broken links * fix: broken link
1 parent 387f246 commit 9b8e91b

File tree

6 files changed

+388
-196
lines changed

6 files changed

+388
-196
lines changed

content/200-orm/050-overview/500-databases/900-turso.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ LIBSQL_DATABASE_TOKEN="..."
132132

133133
### 3. Set up Prisma Config file
134134

135-
Make sure that you have a [`prisma.config.ts`](/orm/reference/prisma-config-reference) file for your project. Then, set up the [migration driver adapter](/orm/reference/prisma-config-reference#adapter) to use `PrismaLibSQL`:
135+
Make sure that you have a [`prisma.config.ts`](/orm/reference/prisma-config-reference) file for your project. Then, set up the [migration driver adapter](/orm/reference/prisma-config-reference#adapter-removed) to use `PrismaLibSQL`:
136136

137137
```ts file=prisma.config.ts
138138
import path from 'node:path'

content/200-orm/050-overview/500-databases/950-cloudflare-d1.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ CLOUDFLARE_D1_TOKEN="F8Cg..."
8484

8585
#### 3. Set up Prisma Config file
8686

87-
Make sure that you have a [`prisma.config.ts`](/orm/reference/prisma-config-reference) file for your project. Then, set up the [migration driver adapter](/orm/reference/prisma-config-reference#adapter) to reference D1:
87+
Make sure that you have a [`prisma.config.ts`](/orm/reference/prisma-config-reference) file for your project. Then, set up the [migration driver adapter](/orm/reference/prisma-config-reference#adapter-removed) to reference D1:
8888

8989
```ts file=prisma.config.ts
9090
import type { PrismaConfig } from 'prisma';

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

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,17 @@ If you want to use external tables, here's the main workflow:
4949
You can specify externally managed tables in your [Prisma Config](/orm/reference/prisma-config-reference) file via the `tables.external` property:
5050

5151
```ts file=prisma.config.ts
52+
import 'dotenv/config'
53+
import { defineConfig, env } from 'prisma/config'
54+
5255
export default defineConfig({
56+
schema: 'prisma/schema.prisma',
57+
migrations: {
58+
path: 'prisma/migrations',
59+
},
60+
datasource: {
61+
url: env('DATABASE_URL'),
62+
},
5363
// required when using unstable features
5464
experimental: {
5565
// add-next-line
@@ -88,7 +98,14 @@ If the external table is not referenced by any managed table—that is no manage
8898

8999

90100
```ts file=prisma.config.ts
101+
import 'dotenv/config'
102+
import { defineConfig, env } from 'prisma/config'
103+
91104
export default defineConfig({
105+
schema: 'prisma/schema.prisma',
106+
datasource: {
107+
url: env('DATABASE_URL'),
108+
},
92109
// required when using unstable features
93110
experimental: {
94111
// add-next-line
@@ -102,6 +119,7 @@ export default defineConfig({
102119
]
103120
},
104121
migrations: {
122+
path: 'prisma/migrations',
105123
// setup the users table for the shadow database
106124
initShadowDb: `
107125
CREATE TABLE public.users (id SERIAL PRIMARY KEY);
@@ -168,7 +186,17 @@ CREATE TABLE posts (
168186
Enable use of externally managed tables via the `tables.external` property:
169187

170188
```ts file=prisma.config.ts
189+
import 'dotenv/config'
190+
import { defineConfig, env } from 'prisma/config'
191+
171192
export default defineConfig({
193+
schema: 'prisma/schema.prisma',
194+
migrations: {
195+
path: 'prisma/migrations',
196+
},
197+
datasource: {
198+
url: env('DATABASE_URL'),
199+
},
172200
experimental: {
173201
// add-next-line
174202
externalTables: true
@@ -280,12 +308,26 @@ enum role {
280308

281309
Then add a `migrations.initShadowDb` script so Prisma knows about the `users` table during migrations.
282310

283-
```ts
284-
// prisma.config.ts
311+
```ts file=prisma.config.ts
312+
import 'dotenv/config'
313+
import { defineConfig, env } from 'prisma/config'
314+
285315
export default defineConfig({
286-
// ...
316+
schema: 'prisma/schema.prisma',
317+
datasource: {
318+
url: env('DATABASE_URL'),
319+
},
320+
experimental: {
321+
externalTables: true
322+
},
323+
tables: {
324+
external: [
325+
"public.users",
326+
]
327+
},
287328
// add-start
288329
migrations: {
330+
path: 'prisma/migrations',
289331
// setup the users table for the shadow database
290332
initShadowDb: `
291333
CREATE TABLE public.users (id SERIAL PRIMARY KEY);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ A `datasource` block accepts the following fields:
2020
| `provider` | **Yes** | String (`postgresql`, `mysql`, `sqlite`, `sqlserver`, `mongodb`, `cockroachdb`) | Describes which data source connectors to use. |
2121
| `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. |
2222
| `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). |
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-removed). |
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

0 commit comments

Comments
 (0)