speed 1.1.2 → 1.1.3
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 +16 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
## SpeedSQL
|
|
2
|
+
|
|
3
|
+
SQL injection for NestJS, similar mybatis.
|
|
4
|
+
|
|
1
5
|
### Introduction
|
|
2
6
|
|
|
3
7
|
- Follow NestJS Module injection mode.
|
|
@@ -7,6 +11,16 @@
|
|
|
7
11
|
- Support for Entity Injection.
|
|
8
12
|
- Support the Connection pools by mysql2 within.
|
|
9
13
|
|
|
14
|
+
### Install as a dependency
|
|
15
|
+
|
|
16
|
+
Setup SpeedSQL (NPM named `speed`) as dependency in *package.json* file `dependencies`
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"speed": "latest"
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
10
24
|
### Quick Start
|
|
11
25
|
|
|
12
26
|
- Prepare some entities and configurations.
|
|
@@ -109,7 +123,6 @@ export class AppController {
|
|
|
109
123
|
|
|
110
124
|
@Get()
|
|
111
125
|
async getHello() {
|
|
112
|
-
//const word = await this.appService.getMyWord(new ParamDto('world', 20));
|
|
113
126
|
await this.appService.setUserAge("zzz", 20);
|
|
114
127
|
return "hello world";
|
|
115
128
|
}
|
|
@@ -230,9 +243,9 @@ const users: UserDto[] = await this.appService.getRecords('zzz', 10);
|
|
|
230
243
|
|
|
231
244
|
### Select
|
|
232
245
|
|
|
233
|
-
SpeedSQL uses ```@
|
|
246
|
+
SpeedSQL uses ```@ResultType``` to annotate the resulting entity.
|
|
234
247
|
|
|
235
|
-
Select returns an array of annotated entity (```@
|
|
248
|
+
Select returns an array of annotated entity (```@ResultType```).
|
|
236
249
|
|
|
237
250
|
- Create a entity:
|
|
238
251
|
|
package/package.json
CHANGED