@custom-generators/simple-prisma-dto-gen 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
+
# On a Nestjs project
|
|
2
|
+
|
|
1
3
|
npm install prisma --save-dev
|
|
2
4
|
npm install --save dotenv @prisma/adapter-mariadb @prisma/client mariadb
|
|
3
5
|
|
|
4
6
|
npx prisma init
|
|
5
7
|
|
|
6
|
-
main.ts
|
|
8
|
+
# Edit main.ts
|
|
9
|
+
|
|
7
10
|
|
|
8
11
|
import 'dotenv/config'
|
|
9
12
|
|
|
10
|
-
database.service.ts
|
|
13
|
+
# Edit database.service.ts
|
|
11
14
|
|
|
12
15
|
import { Injectable } from "@nestjs/common"
|
|
13
16
|
import { DatabaseGenService } from "./gen.dto/service/database.gen"
|
|
@@ -21,6 +24,8 @@ export class DatabaseService extends DatabaseGenService {
|
|
|
21
24
|
}
|
|
22
25
|
}
|
|
23
26
|
|
|
27
|
+
# On prisma.schema
|
|
28
|
+
|
|
24
29
|
generator client {
|
|
25
30
|
provider = "prisma-client"
|
|
26
31
|
output = "../src/generated/client"
|
|
@@ -34,7 +39,11 @@ generator classGenerator {
|
|
|
34
39
|
generatePrismaService = true
|
|
35
40
|
}
|
|
36
41
|
|
|
37
|
-
|
|
42
|
+
# On .env
|
|
43
|
+
|
|
44
|
+
DATABASE_URL=mysql://root:123456@192.168.0.10:3306/mydatabase
|
|
45
|
+
|
|
46
|
+
# Configure debug (optional)
|
|
38
47
|
|
|
39
48
|
{
|
|
40
49
|
"version": "0.2.0",
|