Skip to content

Commit b1c1bb0

Browse files
committed
Merge branch 'prisma2' of github.com:nikolasburk/docs.nestjs.com into prisma2
2 parents e2ab5c4 + fef1e92 commit b1c1bb0

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

content/recipes/prisma.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Start by installing the Prisma CLI as a development dependency in your project:
4444
$ npm install @prisma/cli --save-dev
4545
```
4646

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`:
4848

4949
```bash
5050
$ npx prisma
@@ -72,14 +72,14 @@ Now create your initial Prisma setup using the `init` command of the Prisma CLI:
7272
$ npx prisma init
7373
```
7474

75-
This command created a new `prisma` directory with the following contents:
75+
This command creates a new `prisma` directory with the following contents:
7676

7777
- `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
7979

8080
##### 3. Create your SQLite database file and set the database connection
8181

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.
8383

8484
Navigate into the new `prisma` directory and create a file called `dev.db` inside of it.
8585

@@ -209,7 +209,7 @@ Note that Prisma also features a _schema migration_ tool called [Prisma Migrate]
209209

210210
##### 5. Introspect your database to obtain your Prisma models in the Prisma schema
211211

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.
213213

214214
To introspect your database, run the following command in your terminal:
215215

@@ -256,7 +256,7 @@ To install Prisma Client in your project, run the following command in your term
256256
$ npm install @prisma/client
257257
```
258258

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.
260260

261261
> **Note** The `prisma generate` command reads your Prisma schema and updates the generated Prisma Client library inside `node_modules/@prisma/client`.
262262
@@ -357,7 +357,7 @@ export class UserService {
357357
}
358358
```
359359

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.
361361

362362
Now do the same for the `Post` model.
363363

@@ -554,6 +554,6 @@ This controller implements the following routes:
554554

555555
#### Summary
556556

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.
558558

559559
If you want to learn more about Prisma, be sure to check out the [documentation](https://www.prisma.io/docs/).

0 commit comments

Comments
 (0)