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
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ Start by installing the Prisma CLI as a development dependency in your project:
44
44
$ npm install @prisma/cli --save-dev
45
45
```
46
46
47
-
As a best practice, it's recommended to invoke the CLI locally by prefixing it with `npx`:
47
+
In the following steps, we'll be utilizing the [Prisma CLI](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-cli). As a best practice, it's recommended to invoke the CLI locally by prefixing it with `npx`:
48
48
49
49
```bash
50
50
$ npx prisma
@@ -72,14 +72,14 @@ Now create your initial Prisma setup using the `init` command of the Prisma CLI:
72
72
$ npx prisma init
73
73
```
74
74
75
-
This command created a new `prisma` directory with the following contents:
75
+
This command creates a new `prisma` directory with the following contents:
76
76
77
77
-`schema.prisma`: Specifies your database connection and contains the database schema
78
-
-`.env`: A [dotenv](https://github.com/motdotla/dotenv) file, typically used to store your database credentials in an environment variable
78
+
-`.env`: A [dotenv](https://github.com/motdotla/dotenv) file, typically used to store your database credentials in a group of environment variables
79
79
80
80
##### 3. Create your SQLite database file and set the database connection
81
81
82
-
SQLite databases are simple files, no server is required to use a SQLite database. You can therefore create a new SQLite database by manually creating a new file on your file system.
82
+
SQLite databases are simple files; no server is required to use a SQLite database. You can therefore create a new SQLite database by manually creating a new file on your file system.
83
83
84
84
Navigate into the new `prisma` directory and create a file called `dev.db` inside of it.
85
85
@@ -209,7 +209,7 @@ Note that Prisma also features a _schema migration_ tool called [Prisma Migrate]
209
209
210
210
##### 5. Introspect your database to obtain your Prisma models in the Prisma schema
211
211
212
-
Now that you created your database tables, you can _introspect_ the database to generate your [Prisma models](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-schema/models). After that, you will install and generate Prisma Client which will expose queries that are _tailored_ to these models.
212
+
Now that you've created your database tables, you can _introspect_ the database to generate your [Prisma models](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-schema/models). After that, you will install and generate Prisma Client, which will expose queries that are _tailored_ to these models.
213
213
214
214
To introspect your database, run the following command in your terminal:
215
215
@@ -256,7 +256,7 @@ To install Prisma Client in your project, run the following command in your term
256
256
$ npm install @prisma/client
257
257
```
258
258
259
-
Note that this command automatically invokes the `prisma generate` command for you. In the future, you need to run this command after _every_ change to your Prisma models to update your generated Prisma Client.
259
+
Note that during installation, Prisma automatically invokes the `prisma generate` command for you. In the future, you need to run this command after _every_ change to your Prisma models to update your generated Prisma Client.
260
260
261
261
> **Note** The `prisma generate` command reads your Prisma schema and updates the generated Prisma Client library inside `node_modules/@prisma/client`.
262
262
@@ -357,7 +357,7 @@ export class UserService {
357
357
}
358
358
```
359
359
360
-
Notice how you're using Prisma Client's generated types to ensure that the methods that are exposed by your service are properly typed! You therefore save the boilerplate of typing your models and creating additional interface or DTO files.
360
+
Notice how you're using Prisma Client's generated types to ensure that the methods that are exposed by your service are properly typed. You therefore save the boilerplate of typing your models and creating additional interface or DTO files.
361
361
362
362
Now do the same for the `Post` model.
363
363
@@ -554,6 +554,6 @@ This controller implements the following routes:
554
554
555
555
#### Summary
556
556
557
-
In this guide, you learned how to implement a use NestJS together with Prisma to implement a REST API. The controller who implements the routes of the API is calling a `PrismaService` which in turn uses Prisma Client to send queries to a database to fulfill the data needs of incoming requests.
557
+
In this recipe, you learned how to use Prisma along with NestJS to implement a REST API. The controller that implements the routes of the API is calling a `PrismaService` which in turn uses Prisma Client to send queries to a database to fulfill the data needs of incoming requests.
558
558
559
559
If you want to learn more about Prisma, be sure to check out the [documentation](https://www.prisma.io/docs/).
0 commit comments