Skip to content

Commit c46f20a

Browse files
committed
add prisma config updates
1 parent cd68be5 commit c46f20a

File tree

1 file changed

+33
-2
lines changed

1 file changed

+33
-2
lines changed

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

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ export declare type PrismaConfig = {
6767
// The path to the schema file, or path to a folder that shall be recursively searched for *.prisma files.
6868
schema?: string;
6969

70-
// The Driver Adapter used for Prisma CLI.
70+
// Configuration for the driver adapter used for Prisma CLI.
7171
adapter?: () => Promise<SqlMigrationAwareDriverAdapterFactory>;
7272

73-
// The configuration for Prisma Studio.
73+
// Configuration for Prisma Studio.
7474
studio?: {
7575
adapter: () => Promise<SqlMigrationAwareDriverAdapterFactory>;
7676
};
@@ -91,6 +91,15 @@ export declare type PrismaConfig = {
9191
typedSql?: {
9292
path: string;
9393
};
94+
95+
// Configuration to specify how the CLI should connect to the DB.
96+
engine: "classic" | "js";
97+
98+
// Configuration of your database connection details.
99+
datasource: {
100+
url: string;
101+
shadowDatabaseUrl?: string;
102+
};
94103
};
95104
```
96105

@@ -331,6 +340,28 @@ Failed to load config file "~" as a TypeScript/JavaScript module. Error: Error:
331340

332341
:::
333342

343+
### `engine`
344+
345+
Determines whether you want to configure the database connection details via the `datasource` or an `adapter`.
346+
347+
| Property | Type | Required | Default |
348+
| -------- | ------------------- | -------- | ------- |
349+
| `engine` | `"classic" \| "js"` | No | none |
350+
351+
Note that:
352+
353+
- if you're using `"classic"`, you must specify a `datasource` objedct with a `url`
354+
- if you're using `"js"`, you must provide an `adapter` function
355+
356+
### `datasource`
357+
358+
Defines the database connection details. Only valid when `engine` is set to `"classic"`.
359+
360+
| Property | Type | Required | Default |
361+
| ------------------------------ | -------- | -------- | ------- |
362+
| `datasource.url` | `string` | Yes | none |
363+
| `datasource.shadowDatabaseUrl` | `string` | No | none |
364+
334365
## Common patterns
335366

336367
### Setting up your project

0 commit comments

Comments
 (0)