You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/recipes/prisma.md
+31-4Lines changed: 31 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,6 +67,29 @@ This command creates a new `prisma` directory with the following contents:
67
67
-`schema.prisma`: Specifies your database connection and contains the database schema
68
68
-`.env`: A [dotenv](https://github.com/motdotla/dotenv) file, typically used to store your database credentials in a group of environment variables
69
69
70
+
#### Set the generator output path
71
+
72
+
> warning **Warning** In Prisma ORM 7, Prisma Client will no longer be generated in `node_modules` by default and will require an output path to be defined. [Learn more below on how to define an output path](https://www.prisma.io/docs/orm/prisma-client/setup-and-configuration/generating-prisma-client#using-a-custom-output-path).
73
+
74
+
Specify your output `path` for the generated Prisma client either by passing `--output ../generated/prisma` during prisma init, or directly in your Prisma schema:
75
+
76
+
```groovy
77
+
generator client {
78
+
provider = "prisma-client-js"
79
+
output = "../generated/prisma"
80
+
}
81
+
```
82
+
83
+
By default, Nest does not include the generated Prisma client in the build. To fix this, the path should be explicitly defined in `tsconfig.build.json`:
Your database connection is configured in the `datasource` block in your `schema.prisma` file. By default it's set to `postgresql`, but since you're using a SQLite database in this guide you need to adjust the `provider` field of the `datasource` block to `sqlite`:
@@ -79,6 +102,7 @@ datasource db {
79
102
80
103
generator client {
81
104
provider = "prisma-client-js"
105
+
output = "../generated/prisma"
82
106
}
83
107
```
84
108
@@ -110,6 +134,7 @@ datasource db {
110
134
111
135
generator client {
112
136
provider = "prisma-client-js"
137
+
output = "../generated/prisma"
113
138
}
114
139
```
115
140
@@ -141,6 +166,7 @@ datasource db {
141
166
142
167
generator client {
143
168
provider = "prisma-client-js"
169
+
output = "../generated/prisma"
144
170
}
145
171
```
146
172
@@ -166,6 +192,7 @@ datasource db {
166
192
167
193
generator client {
168
194
provider = "prisma-client-js"
195
+
output = "../generated/prisma"
169
196
}
170
197
```
171
198
@@ -274,7 +301,7 @@ Inside the `src` directory, create a new file called `prisma.service.ts` and add
0 commit comments