@breautek/storm 4.3.0 → 4.4.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/CHANGELOG.md +14 -0
- package/docs/README.md +28 -20
- package/docs/classes/Application.md +158 -76
- package/docs/classes/BackendAuthenticationMiddleware.md +3 -3
- package/docs/classes/CORSMiddleware.md +8 -8
- package/docs/classes/ConfigLoader.md +1 -1
- package/docs/classes/Database.md +12 -12
- package/docs/classes/DatabaseConnection.md +42 -40
- package/docs/classes/DatabaseQueryError.md +22 -18
- package/docs/classes/DeadLockError.md +349 -0
- package/docs/classes/DiskSpaceError.md +20 -18
- package/docs/classes/DropTemporaryTableQuery.md +8 -8
- package/docs/classes/DumpStream.md +1 -1
- package/docs/classes/DuplicateEntryError.md +20 -18
- package/docs/classes/EntityNotFoundError.md +20 -18
- package/docs/classes/ExpiredTokenError.md +20 -18
- package/docs/classes/Handler.md +14 -14
- package/docs/classes/InternalError.md +20 -18
- package/docs/classes/InvalidCredentialsError.md +20 -18
- package/docs/classes/InvalidValueError.md +20 -18
- package/docs/classes/ManagedDatabaseConnection.md +19 -19
- package/docs/classes/Middleware.md +3 -3
- package/docs/classes/MissingConfigError.md +20 -18
- package/docs/classes/MissingParameterError.md +20 -18
- package/docs/classes/MySQLConnection.md +73 -43
- package/docs/classes/MySQLDatabase.md +13 -13
- package/docs/classes/NotImplementedError.md +20 -18
- package/docs/classes/Query.md +8 -8
- package/docs/classes/RawError.md +20 -20
- package/docs/classes/RawQuery.md +8 -8
- package/docs/classes/Request.md +18 -18
- package/docs/classes/Response.md +11 -11
- package/docs/classes/ResponseData.md +7 -7
- package/docs/classes/ServiceProvider.md +15 -15
- package/docs/classes/ServiceResponse.md +4 -4
- package/docs/classes/SetSessionVariableQuery.md +8 -8
- package/docs/classes/StormError.md +20 -18
- package/docs/classes/TemporaryTableQuery.md +8 -8
- package/docs/classes/Token.md +2 -2
- package/docs/classes/TokenManager.md +4 -4
- package/docs/classes/UnauthorizedAccessError.md +20 -18
- package/docs/enums/ErrorCode.md +18 -18
- package/docs/enums/ExitCode.md +4 -4
- package/docs/enums/HTTPMethod.md +8 -8
- package/docs/enums/JWTError.md +4 -4
- package/docs/enums/StatusCode.md +96 -96
- package/docs/interfaces/IConfig.md +8 -8
- package/docs/interfaces/IDatabaseConfig.md +6 -6
- package/docs/interfaces/IDatabaseConnection.md +14 -14
- package/docs/interfaces/IErrorResponse.md +5 -5
- package/docs/interfaces/IFormData.md +2 -2
- package/docs/interfaces/IHandler.md +1 -1
- package/docs/interfaces/IInsertQueryResult.md +3 -3
- package/docs/interfaces/IJWTVerifyOptions.md +1 -1
- package/docs/interfaces/IRequestResponse.md +2 -2
- package/docs/interfaces/ISetSessionVariableQueryInput.md +2 -2
- package/docs/interfaces/ITemporaryTableQueryInput.md +2 -2
- package/docs/interfaces/IUpdateQueryResult.md +2 -2
- package/docs/interfaces/formidable.File.md +3 -1
- package/docs/interfaces/formidable.FileJSON.md +3 -1
- package/docs/interfaces/formidable.Options.md +33 -11
- package/docs/interfaces/formidable.Part.md +65 -35
- package/lib/DeadLockError.d.ts +6 -0
- package/lib/DeadLockError.js +26 -0
- package/lib/DeadLockError.js.map +1 -0
- package/lib/MySQLConnection.js +11 -1
- package/lib/MySQLConnection.js.map +1 -1
- package/lib/api.d.ts +1 -0
- package/lib/api.js +3 -1
- package/lib/api.js.map +1 -1
- package/package.json +19 -18
- package/src/DeadLockError.ts +22 -0
- package/src/MySQLConnection.ts +13 -1
- package/src/api.ts +1 -0
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
|
|
54
54
|
#### Defined in
|
|
55
55
|
|
|
56
|
-
[src/MissingConfigError.ts:27](https://github.com/breautek/storm/blob/
|
|
56
|
+
[src/MissingConfigError.ts:27](https://github.com/breautek/storm/blob/306a47f/src/MissingConfigError.ts#L27)
|
|
57
57
|
|
|
58
58
|
## Properties
|
|
59
59
|
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
|
|
68
68
|
#### Defined in
|
|
69
69
|
|
|
70
|
-
node_modules/typescript/lib/lib.es5.d.ts:
|
|
70
|
+
node_modules/typescript/lib/lib.es5.d.ts:1041
|
|
71
71
|
|
|
72
72
|
___
|
|
73
73
|
|
|
@@ -81,7 +81,7 @@ ___
|
|
|
81
81
|
|
|
82
82
|
#### Defined in
|
|
83
83
|
|
|
84
|
-
node_modules/typescript/lib/lib.es5.d.ts:
|
|
84
|
+
node_modules/typescript/lib/lib.es5.d.ts:1040
|
|
85
85
|
|
|
86
86
|
___
|
|
87
87
|
|
|
@@ -95,7 +95,7 @@ ___
|
|
|
95
95
|
|
|
96
96
|
#### Defined in
|
|
97
97
|
|
|
98
|
-
node_modules/typescript/lib/lib.es5.d.ts:
|
|
98
|
+
node_modules/typescript/lib/lib.es5.d.ts:1042
|
|
99
99
|
|
|
100
100
|
___
|
|
101
101
|
|
|
@@ -109,7 +109,9 @@ ___
|
|
|
109
109
|
|
|
110
110
|
Optional override for formatting stack traces
|
|
111
111
|
|
|
112
|
-
**`
|
|
112
|
+
**`See`**
|
|
113
|
+
|
|
114
|
+
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
|
|
113
115
|
|
|
114
116
|
##### Parameters
|
|
115
117
|
|
|
@@ -128,7 +130,7 @@ Optional override for formatting stack traces
|
|
|
128
130
|
|
|
129
131
|
#### Defined in
|
|
130
132
|
|
|
131
|
-
node_modules/@types/node/globals.d.ts:11
|
|
133
|
+
node_modules/@types/node/ts4.8/globals.d.ts:11
|
|
132
134
|
|
|
133
135
|
___
|
|
134
136
|
|
|
@@ -142,7 +144,7 @@ ___
|
|
|
142
144
|
|
|
143
145
|
#### Defined in
|
|
144
146
|
|
|
145
|
-
node_modules/@types/node/globals.d.ts:13
|
|
147
|
+
node_modules/@types/node/ts4.8/globals.d.ts:13
|
|
146
148
|
|
|
147
149
|
## Methods
|
|
148
150
|
|
|
@@ -160,7 +162,7 @@ node_modules/@types/node/globals.d.ts:13
|
|
|
160
162
|
|
|
161
163
|
#### Defined in
|
|
162
164
|
|
|
163
|
-
[src/MissingConfigError.ts:37](https://github.com/breautek/storm/blob/
|
|
165
|
+
[src/MissingConfigError.ts:37](https://github.com/breautek/storm/blob/306a47f/src/MissingConfigError.ts#L37)
|
|
164
166
|
|
|
165
167
|
___
|
|
166
168
|
|
|
@@ -178,7 +180,7 @@ ___
|
|
|
178
180
|
|
|
179
181
|
#### Defined in
|
|
180
182
|
|
|
181
|
-
[src/StormError.ts:76](https://github.com/breautek/storm/blob/
|
|
183
|
+
[src/StormError.ts:76](https://github.com/breautek/storm/blob/306a47f/src/StormError.ts#L76)
|
|
182
184
|
|
|
183
185
|
___
|
|
184
186
|
|
|
@@ -196,7 +198,7 @@ ___
|
|
|
196
198
|
|
|
197
199
|
#### Defined in
|
|
198
200
|
|
|
199
|
-
[src/MissingConfigError.ts:45](https://github.com/breautek/storm/blob/
|
|
201
|
+
[src/MissingConfigError.ts:45](https://github.com/breautek/storm/blob/306a47f/src/MissingConfigError.ts#L45)
|
|
200
202
|
|
|
201
203
|
___
|
|
202
204
|
|
|
@@ -214,7 +216,7 @@ ___
|
|
|
214
216
|
|
|
215
217
|
#### Defined in
|
|
216
218
|
|
|
217
|
-
[src/MissingConfigError.ts:41](https://github.com/breautek/storm/blob/
|
|
219
|
+
[src/MissingConfigError.ts:41](https://github.com/breautek/storm/blob/306a47f/src/MissingConfigError.ts#L41)
|
|
218
220
|
|
|
219
221
|
___
|
|
220
222
|
|
|
@@ -232,7 +234,7 @@ ___
|
|
|
232
234
|
|
|
233
235
|
#### Defined in
|
|
234
236
|
|
|
235
|
-
[src/MissingConfigError.ts:49](https://github.com/breautek/storm/blob/
|
|
237
|
+
[src/MissingConfigError.ts:49](https://github.com/breautek/storm/blob/306a47f/src/MissingConfigError.ts#L49)
|
|
236
238
|
|
|
237
239
|
___
|
|
238
240
|
|
|
@@ -250,7 +252,7 @@ ___
|
|
|
250
252
|
|
|
251
253
|
#### Defined in
|
|
252
254
|
|
|
253
|
-
[src/MissingConfigError.ts:53](https://github.com/breautek/storm/blob/
|
|
255
|
+
[src/MissingConfigError.ts:53](https://github.com/breautek/storm/blob/306a47f/src/MissingConfigError.ts#L53)
|
|
254
256
|
|
|
255
257
|
___
|
|
256
258
|
|
|
@@ -268,7 +270,7 @@ ___
|
|
|
268
270
|
|
|
269
271
|
#### Defined in
|
|
270
272
|
|
|
271
|
-
[src/MissingConfigError.ts:33](https://github.com/breautek/storm/blob/
|
|
273
|
+
[src/MissingConfigError.ts:33](https://github.com/breautek/storm/blob/306a47f/src/MissingConfigError.ts#L33)
|
|
272
274
|
|
|
273
275
|
___
|
|
274
276
|
|
|
@@ -276,7 +278,7 @@ ___
|
|
|
276
278
|
|
|
277
279
|
▸ **getPrivateDetails**(): `IMissingConfigErrorDetails`
|
|
278
280
|
|
|
279
|
-
Private details are only logged to the server log.
|
|
281
|
+
Private details are only logged to the server log.
|
|
280
282
|
They are kept secret from the client.
|
|
281
283
|
|
|
282
284
|
#### Returns
|
|
@@ -289,7 +291,7 @@ They are kept secret from the client.
|
|
|
289
291
|
|
|
290
292
|
#### Defined in
|
|
291
293
|
|
|
292
|
-
[src/StormError.ts:68](https://github.com/breautek/storm/blob/
|
|
294
|
+
[src/StormError.ts:68](https://github.com/breautek/storm/blob/306a47f/src/StormError.ts#L68)
|
|
293
295
|
|
|
294
296
|
___
|
|
295
297
|
|
|
@@ -309,7 +311,7 @@ Sends details to the client.
|
|
|
309
311
|
|
|
310
312
|
#### Defined in
|
|
311
313
|
|
|
312
|
-
[src/StormError.ts:60](https://github.com/breautek/storm/blob/
|
|
314
|
+
[src/StormError.ts:60](https://github.com/breautek/storm/blob/306a47f/src/StormError.ts#L60)
|
|
313
315
|
|
|
314
316
|
___
|
|
315
317
|
|
|
@@ -336,4 +338,4 @@ Create .stack property on a target object
|
|
|
336
338
|
|
|
337
339
|
#### Defined in
|
|
338
340
|
|
|
339
|
-
node_modules/@types/node/globals.d.ts:4
|
|
341
|
+
node_modules/@types/node/ts4.8/globals.d.ts:4
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
|
|
54
54
|
#### Defined in
|
|
55
55
|
|
|
56
|
-
[src/MissingParameterError.ts:22](https://github.com/breautek/storm/blob/
|
|
56
|
+
[src/MissingParameterError.ts:22](https://github.com/breautek/storm/blob/306a47f/src/MissingParameterError.ts#L22)
|
|
57
57
|
|
|
58
58
|
## Properties
|
|
59
59
|
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
|
|
68
68
|
#### Defined in
|
|
69
69
|
|
|
70
|
-
node_modules/typescript/lib/lib.es5.d.ts:
|
|
70
|
+
node_modules/typescript/lib/lib.es5.d.ts:1041
|
|
71
71
|
|
|
72
72
|
___
|
|
73
73
|
|
|
@@ -81,7 +81,7 @@ ___
|
|
|
81
81
|
|
|
82
82
|
#### Defined in
|
|
83
83
|
|
|
84
|
-
node_modules/typescript/lib/lib.es5.d.ts:
|
|
84
|
+
node_modules/typescript/lib/lib.es5.d.ts:1040
|
|
85
85
|
|
|
86
86
|
___
|
|
87
87
|
|
|
@@ -95,7 +95,7 @@ ___
|
|
|
95
95
|
|
|
96
96
|
#### Defined in
|
|
97
97
|
|
|
98
|
-
node_modules/typescript/lib/lib.es5.d.ts:
|
|
98
|
+
node_modules/typescript/lib/lib.es5.d.ts:1042
|
|
99
99
|
|
|
100
100
|
___
|
|
101
101
|
|
|
@@ -109,7 +109,9 @@ ___
|
|
|
109
109
|
|
|
110
110
|
Optional override for formatting stack traces
|
|
111
111
|
|
|
112
|
-
**`
|
|
112
|
+
**`See`**
|
|
113
|
+
|
|
114
|
+
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
|
|
113
115
|
|
|
114
116
|
##### Parameters
|
|
115
117
|
|
|
@@ -128,7 +130,7 @@ Optional override for formatting stack traces
|
|
|
128
130
|
|
|
129
131
|
#### Defined in
|
|
130
132
|
|
|
131
|
-
node_modules/@types/node/globals.d.ts:11
|
|
133
|
+
node_modules/@types/node/ts4.8/globals.d.ts:11
|
|
132
134
|
|
|
133
135
|
___
|
|
134
136
|
|
|
@@ -142,7 +144,7 @@ ___
|
|
|
142
144
|
|
|
143
145
|
#### Defined in
|
|
144
146
|
|
|
145
|
-
node_modules/@types/node/globals.d.ts:13
|
|
147
|
+
node_modules/@types/node/ts4.8/globals.d.ts:13
|
|
146
148
|
|
|
147
149
|
## Methods
|
|
148
150
|
|
|
@@ -160,7 +162,7 @@ node_modules/@types/node/globals.d.ts:13
|
|
|
160
162
|
|
|
161
163
|
#### Defined in
|
|
162
164
|
|
|
163
|
-
[src/MissingParameterError.ts:30](https://github.com/breautek/storm/blob/
|
|
165
|
+
[src/MissingParameterError.ts:30](https://github.com/breautek/storm/blob/306a47f/src/MissingParameterError.ts#L30)
|
|
164
166
|
|
|
165
167
|
___
|
|
166
168
|
|
|
@@ -178,7 +180,7 @@ ___
|
|
|
178
180
|
|
|
179
181
|
#### Defined in
|
|
180
182
|
|
|
181
|
-
[src/StormError.ts:76](https://github.com/breautek/storm/blob/
|
|
183
|
+
[src/StormError.ts:76](https://github.com/breautek/storm/blob/306a47f/src/StormError.ts#L76)
|
|
182
184
|
|
|
183
185
|
___
|
|
184
186
|
|
|
@@ -196,7 +198,7 @@ ___
|
|
|
196
198
|
|
|
197
199
|
#### Defined in
|
|
198
200
|
|
|
199
|
-
[src/StormError.ts:97](https://github.com/breautek/storm/blob/
|
|
201
|
+
[src/StormError.ts:97](https://github.com/breautek/storm/blob/306a47f/src/StormError.ts#L97)
|
|
200
202
|
|
|
201
203
|
___
|
|
202
204
|
|
|
@@ -214,7 +216,7 @@ ___
|
|
|
214
216
|
|
|
215
217
|
#### Defined in
|
|
216
218
|
|
|
217
|
-
[src/MissingParameterError.ts:34](https://github.com/breautek/storm/blob/
|
|
219
|
+
[src/MissingParameterError.ts:34](https://github.com/breautek/storm/blob/306a47f/src/MissingParameterError.ts#L34)
|
|
218
220
|
|
|
219
221
|
___
|
|
220
222
|
|
|
@@ -232,7 +234,7 @@ ___
|
|
|
232
234
|
|
|
233
235
|
#### Defined in
|
|
234
236
|
|
|
235
|
-
[src/MissingParameterError.ts:38](https://github.com/breautek/storm/blob/
|
|
237
|
+
[src/MissingParameterError.ts:38](https://github.com/breautek/storm/blob/306a47f/src/MissingParameterError.ts#L38)
|
|
236
238
|
|
|
237
239
|
___
|
|
238
240
|
|
|
@@ -250,7 +252,7 @@ ___
|
|
|
250
252
|
|
|
251
253
|
#### Defined in
|
|
252
254
|
|
|
253
|
-
[src/MissingParameterError.ts:42](https://github.com/breautek/storm/blob/
|
|
255
|
+
[src/MissingParameterError.ts:42](https://github.com/breautek/storm/blob/306a47f/src/MissingParameterError.ts#L42)
|
|
254
256
|
|
|
255
257
|
___
|
|
256
258
|
|
|
@@ -268,7 +270,7 @@ ___
|
|
|
268
270
|
|
|
269
271
|
#### Defined in
|
|
270
272
|
|
|
271
|
-
[src/MissingParameterError.ts:26](https://github.com/breautek/storm/blob/
|
|
273
|
+
[src/MissingParameterError.ts:26](https://github.com/breautek/storm/blob/306a47f/src/MissingParameterError.ts#L26)
|
|
272
274
|
|
|
273
275
|
___
|
|
274
276
|
|
|
@@ -276,7 +278,7 @@ ___
|
|
|
276
278
|
|
|
277
279
|
▸ **getPrivateDetails**(): `any`
|
|
278
280
|
|
|
279
|
-
Private details are only logged to the server log.
|
|
281
|
+
Private details are only logged to the server log.
|
|
280
282
|
They are kept secret from the client.
|
|
281
283
|
|
|
282
284
|
#### Returns
|
|
@@ -289,7 +291,7 @@ They are kept secret from the client.
|
|
|
289
291
|
|
|
290
292
|
#### Defined in
|
|
291
293
|
|
|
292
|
-
[src/StormError.ts:68](https://github.com/breautek/storm/blob/
|
|
294
|
+
[src/StormError.ts:68](https://github.com/breautek/storm/blob/306a47f/src/StormError.ts#L68)
|
|
293
295
|
|
|
294
296
|
___
|
|
295
297
|
|
|
@@ -309,7 +311,7 @@ Sends details to the client.
|
|
|
309
311
|
|
|
310
312
|
#### Defined in
|
|
311
313
|
|
|
312
|
-
[src/StormError.ts:60](https://github.com/breautek/storm/blob/
|
|
314
|
+
[src/StormError.ts:60](https://github.com/breautek/storm/blob/306a47f/src/StormError.ts#L60)
|
|
313
315
|
|
|
314
316
|
___
|
|
315
317
|
|
|
@@ -336,4 +338,4 @@ Create .stack property on a target object
|
|
|
336
338
|
|
|
337
339
|
#### Defined in
|
|
338
340
|
|
|
339
|
-
node_modules/@types/node/globals.d.ts:4
|
|
341
|
+
node_modules/@types/node/ts4.8/globals.d.ts:4
|
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
# Class: MySQLConnection
|
|
4
4
|
|
|
5
|
+
Do not call `new Database` directly. Use `Database.getConnection` to create a `DatabaseConnection` object.
|
|
6
|
+
|
|
7
|
+
**`Abstract`**
|
|
8
|
+
|
|
9
|
+
**`Implements`**
|
|
10
|
+
|
|
11
|
+
`IDatabaseConnection`
|
|
12
|
+
|
|
5
13
|
## Hierarchy
|
|
6
14
|
|
|
7
15
|
- [`DatabaseConnection`](DatabaseConnection.md)<`MySQL.PoolConnection`\>
|
|
@@ -56,7 +64,7 @@
|
|
|
56
64
|
|
|
57
65
|
#### Defined in
|
|
58
66
|
|
|
59
|
-
[src/MySQLConnection.ts:
|
|
67
|
+
[src/MySQLConnection.ts:48](https://github.com/breautek/storm/blob/306a47f/src/MySQLConnection.ts#L48)
|
|
60
68
|
|
|
61
69
|
## Methods
|
|
62
70
|
|
|
@@ -64,14 +72,16 @@
|
|
|
64
72
|
|
|
65
73
|
▸ `Protected` **_close**(`forceClose`): `Promise`<`void`\>
|
|
66
74
|
|
|
67
|
-
Implementation to close the connection, if `forceClose` is true, close the connection no matter what.
|
|
75
|
+
Implementation to close the connection, if `forceClose` is true, close the connection no matter what.
|
|
68
76
|
Silently error if it means the connection is closed.
|
|
69
77
|
|
|
78
|
+
**`Async`**
|
|
79
|
+
|
|
70
80
|
#### Parameters
|
|
71
81
|
|
|
72
|
-
| Name | Type |
|
|
73
|
-
| :------ | :------ |
|
|
74
|
-
| `forceClose` | `boolean` |
|
|
82
|
+
| Name | Type | Description |
|
|
83
|
+
| :------ | :------ | :------ |
|
|
84
|
+
| `forceClose` | `boolean` | boolean, if `true`, should close the connection no matter what. |
|
|
75
85
|
|
|
76
86
|
#### Returns
|
|
77
87
|
|
|
@@ -85,7 +95,7 @@ Promise<void>
|
|
|
85
95
|
|
|
86
96
|
#### Defined in
|
|
87
97
|
|
|
88
|
-
[src/MySQLConnection.ts:
|
|
98
|
+
[src/MySQLConnection.ts:202](https://github.com/breautek/storm/blob/306a47f/src/MySQLConnection.ts#L202)
|
|
89
99
|
|
|
90
100
|
___
|
|
91
101
|
|
|
@@ -95,12 +105,14 @@ ___
|
|
|
95
105
|
|
|
96
106
|
Implementation method to return a dataset from the database
|
|
97
107
|
|
|
108
|
+
**`Async`**
|
|
109
|
+
|
|
98
110
|
#### Parameters
|
|
99
111
|
|
|
100
|
-
| Name | Type |
|
|
101
|
-
| :------ | :------ |
|
|
102
|
-
| `query` | `string` |
|
|
103
|
-
| `params?` | `any` |
|
|
112
|
+
| Name | Type | Description |
|
|
113
|
+
| :------ | :------ | :------ |
|
|
114
|
+
| `query` | `string` | The database query |
|
|
115
|
+
| `params?` | `any` | The query parameters |
|
|
104
116
|
|
|
105
117
|
#### Returns
|
|
106
118
|
|
|
@@ -114,7 +126,7 @@ Promise
|
|
|
114
126
|
|
|
115
127
|
#### Defined in
|
|
116
128
|
|
|
117
|
-
[src/MySQLConnection.ts:
|
|
129
|
+
[src/MySQLConnection.ts:76](https://github.com/breautek/storm/blob/306a47f/src/MySQLConnection.ts#L76)
|
|
118
130
|
|
|
119
131
|
___
|
|
120
132
|
|
|
@@ -122,16 +134,16 @@ ___
|
|
|
122
134
|
|
|
123
135
|
▸ `Protected` **_stream**(`query`, `params?`, `streamOptions?`): `Readable`
|
|
124
136
|
|
|
125
|
-
Implementation method to return a dataset from the database like `query()`,
|
|
137
|
+
Implementation method to return a dataset from the database like `query()`,
|
|
126
138
|
but returns a `Readable` stream instead.
|
|
127
139
|
|
|
128
140
|
#### Parameters
|
|
129
141
|
|
|
130
|
-
| Name | Type |
|
|
131
|
-
| :------ | :------ |
|
|
132
|
-
| `query` | `string` |
|
|
133
|
-
| `params?` | `any` |
|
|
134
|
-
| `streamOptions?` | `any` |
|
|
142
|
+
| Name | Type | Description |
|
|
143
|
+
| :------ | :------ | :------ |
|
|
144
|
+
| `query` | `string` | The database query |
|
|
145
|
+
| `params?` | `any` | The query parameters |
|
|
146
|
+
| `streamOptions?` | `any` | `Readable` stream options |
|
|
135
147
|
|
|
136
148
|
#### Returns
|
|
137
149
|
|
|
@@ -145,7 +157,7 @@ but returns a `Readable` stream instead.
|
|
|
145
157
|
|
|
146
158
|
#### Defined in
|
|
147
159
|
|
|
148
|
-
[src/MySQLConnection.ts:
|
|
160
|
+
[src/MySQLConnection.ts:125](https://github.com/breautek/storm/blob/306a47f/src/MySQLConnection.ts#L125)
|
|
149
161
|
|
|
150
162
|
___
|
|
151
163
|
|
|
@@ -153,11 +165,11 @@ ___
|
|
|
153
165
|
|
|
154
166
|
▸ **close**(`forceClose?`): `Promise`<`void`\>
|
|
155
167
|
|
|
156
|
-
Closes the connection. May error if connection has an active transaction.
|
|
157
|
-
if `forceClose` boolean is true, it will force close the connection, regardless
|
|
168
|
+
Closes the connection. May error if connection has an active transaction.
|
|
169
|
+
if `forceClose` boolean is true, it will force close the connection, regardless
|
|
158
170
|
of transaction state.
|
|
159
171
|
|
|
160
|
-
**`
|
|
172
|
+
**`Async`**
|
|
161
173
|
|
|
162
174
|
#### Parameters
|
|
163
175
|
|
|
@@ -177,7 +189,7 @@ Promise<void>
|
|
|
177
189
|
|
|
178
190
|
#### Defined in
|
|
179
191
|
|
|
180
|
-
[src/DatabaseConnection.ts:168](https://github.com/breautek/storm/blob/
|
|
192
|
+
[src/DatabaseConnection.ts:168](https://github.com/breautek/storm/blob/306a47f/src/DatabaseConnection.ts#L168)
|
|
181
193
|
|
|
182
194
|
___
|
|
183
195
|
|
|
@@ -187,6 +199,10 @@ ___
|
|
|
187
199
|
|
|
188
200
|
Commits a transaction. This will end a transaction.
|
|
189
201
|
|
|
202
|
+
**`Abstract`**
|
|
203
|
+
|
|
204
|
+
**`Async`**
|
|
205
|
+
|
|
190
206
|
#### Returns
|
|
191
207
|
|
|
192
208
|
`Promise`<`void`\>
|
|
@@ -199,7 +215,7 @@ Promise<void>
|
|
|
199
215
|
|
|
200
216
|
#### Defined in
|
|
201
217
|
|
|
202
|
-
[src/MySQLConnection.ts:
|
|
218
|
+
[src/MySQLConnection.ts:186](https://github.com/breautek/storm/blob/306a47f/src/MySQLConnection.ts#L186)
|
|
203
219
|
|
|
204
220
|
___
|
|
205
221
|
|
|
@@ -209,11 +225,15 @@ ___
|
|
|
209
225
|
|
|
210
226
|
Ends a transaction. if `requiresRollback` is `true`, then `rollback()` is invoked. Otherwise, `commit()` is invoked.
|
|
211
227
|
|
|
228
|
+
**`Abstract`**
|
|
229
|
+
|
|
230
|
+
**`Async`**
|
|
231
|
+
|
|
212
232
|
#### Parameters
|
|
213
233
|
|
|
214
|
-
| Name | Type | Default value |
|
|
215
|
-
| :------ | :------ | :------ |
|
|
216
|
-
| `requiresRollback` | `boolean` | `false` |
|
|
234
|
+
| Name | Type | Default value | Description |
|
|
235
|
+
| :------ | :------ | :------ | :------ |
|
|
236
|
+
| `requiresRollback` | `boolean` | `false` | optional boolean |
|
|
217
237
|
|
|
218
238
|
#### Returns
|
|
219
239
|
|
|
@@ -227,7 +247,7 @@ Promise<void>
|
|
|
227
247
|
|
|
228
248
|
#### Defined in
|
|
229
249
|
|
|
230
|
-
[src/MySQLConnection.ts:
|
|
250
|
+
[src/MySQLConnection.ts:166](https://github.com/breautek/storm/blob/306a47f/src/MySQLConnection.ts#L166)
|
|
231
251
|
|
|
232
252
|
___
|
|
233
253
|
|
|
@@ -249,7 +269,7 @@ any
|
|
|
249
269
|
|
|
250
270
|
#### Defined in
|
|
251
271
|
|
|
252
|
-
[src/DatabaseConnection.ts:90](https://github.com/breautek/storm/blob/
|
|
272
|
+
[src/DatabaseConnection.ts:90](https://github.com/breautek/storm/blob/306a47f/src/DatabaseConnection.ts#L90)
|
|
253
273
|
|
|
254
274
|
___
|
|
255
275
|
|
|
@@ -257,7 +277,7 @@ ___
|
|
|
257
277
|
|
|
258
278
|
▸ **getInstantiationStack**(): `string`
|
|
259
279
|
|
|
260
|
-
Gets the callback stacktrace to determine what opened
|
|
280
|
+
Gets the callback stacktrace to determine what opened
|
|
261
281
|
this connection. Useful for debugging lingering connections.
|
|
262
282
|
|
|
263
283
|
#### Returns
|
|
@@ -272,7 +292,7 @@ string - A stacktrace
|
|
|
272
292
|
|
|
273
293
|
#### Defined in
|
|
274
294
|
|
|
275
|
-
[src/DatabaseConnection.ts:72](https://github.com/breautek/storm/blob/
|
|
295
|
+
[src/DatabaseConnection.ts:72](https://github.com/breautek/storm/blob/306a47f/src/DatabaseConnection.ts#L72)
|
|
276
296
|
|
|
277
297
|
___
|
|
278
298
|
|
|
@@ -294,7 +314,7 @@ number in milliseconds
|
|
|
294
314
|
|
|
295
315
|
#### Defined in
|
|
296
316
|
|
|
297
|
-
[src/DatabaseConnection.ts:120](https://github.com/breautek/storm/blob/
|
|
317
|
+
[src/DatabaseConnection.ts:120](https://github.com/breautek/storm/blob/306a47f/src/DatabaseConnection.ts#L120)
|
|
298
318
|
|
|
299
319
|
___
|
|
300
320
|
|
|
@@ -314,7 +334,7 @@ Returns true if the connection has been closed.
|
|
|
314
334
|
|
|
315
335
|
#### Defined in
|
|
316
336
|
|
|
317
|
-
[src/DatabaseConnection.ts:181](https://github.com/breautek/storm/blob/
|
|
337
|
+
[src/DatabaseConnection.ts:181](https://github.com/breautek/storm/blob/306a47f/src/DatabaseConnection.ts#L181)
|
|
318
338
|
|
|
319
339
|
___
|
|
320
340
|
|
|
@@ -328,7 +348,7 @@ ___
|
|
|
328
348
|
|
|
329
349
|
#### Defined in
|
|
330
350
|
|
|
331
|
-
[src/MySQLConnection.ts:
|
|
351
|
+
[src/MySQLConnection.ts:71](https://github.com/breautek/storm/blob/306a47f/src/MySQLConnection.ts#L71)
|
|
332
352
|
|
|
333
353
|
___
|
|
334
354
|
|
|
@@ -336,7 +356,7 @@ ___
|
|
|
336
356
|
|
|
337
357
|
▸ **isReadOnly**(): `boolean`
|
|
338
358
|
|
|
339
|
-
Returns true if connection was created without
|
|
359
|
+
Returns true if connection was created without
|
|
340
360
|
write access
|
|
341
361
|
|
|
342
362
|
#### Returns
|
|
@@ -351,7 +371,7 @@ boolean
|
|
|
351
371
|
|
|
352
372
|
#### Defined in
|
|
353
373
|
|
|
354
|
-
[src/DatabaseConnection.ts:99](https://github.com/breautek/storm/blob/
|
|
374
|
+
[src/DatabaseConnection.ts:99](https://github.com/breautek/storm/blob/306a47f/src/DatabaseConnection.ts#L99)
|
|
355
375
|
|
|
356
376
|
___
|
|
357
377
|
|
|
@@ -361,6 +381,8 @@ ___
|
|
|
361
381
|
|
|
362
382
|
Implementation method to determine if the connection is in an active transaction.
|
|
363
383
|
|
|
384
|
+
**`Abstract`**
|
|
385
|
+
|
|
364
386
|
#### Returns
|
|
365
387
|
|
|
366
388
|
`boolean`
|
|
@@ -373,7 +395,7 @@ boolean
|
|
|
373
395
|
|
|
374
396
|
#### Defined in
|
|
375
397
|
|
|
376
|
-
[src/MySQLConnection.ts:
|
|
398
|
+
[src/MySQLConnection.ts:67](https://github.com/breautek/storm/blob/306a47f/src/MySQLConnection.ts#L67)
|
|
377
399
|
|
|
378
400
|
___
|
|
379
401
|
|
|
@@ -383,7 +405,7 @@ ___
|
|
|
383
405
|
|
|
384
406
|
Queries the database for a dataset.
|
|
385
407
|
|
|
386
|
-
**`
|
|
408
|
+
**`Async`**
|
|
387
409
|
|
|
388
410
|
#### Type parameters
|
|
389
411
|
|
|
@@ -409,7 +431,7 @@ Promise<TQueryResult>
|
|
|
409
431
|
|
|
410
432
|
#### Defined in
|
|
411
433
|
|
|
412
|
-
[src/DatabaseConnection.ts:131](https://github.com/breautek/storm/blob/
|
|
434
|
+
[src/DatabaseConnection.ts:131](https://github.com/breautek/storm/blob/306a47f/src/DatabaseConnection.ts#L131)
|
|
413
435
|
|
|
414
436
|
___
|
|
415
437
|
|
|
@@ -419,6 +441,10 @@ ___
|
|
|
419
441
|
|
|
420
442
|
Rollsback a transaction. This will end a transaction.
|
|
421
443
|
|
|
444
|
+
**`Abstract`**
|
|
445
|
+
|
|
446
|
+
**`Async`**
|
|
447
|
+
|
|
422
448
|
#### Returns
|
|
423
449
|
|
|
424
450
|
`Promise`<`void`\>
|
|
@@ -431,7 +457,7 @@ Promise<void>
|
|
|
431
457
|
|
|
432
458
|
#### Defined in
|
|
433
459
|
|
|
434
|
-
[src/MySQLConnection.ts:
|
|
460
|
+
[src/MySQLConnection.ts:170](https://github.com/breautek/storm/blob/306a47f/src/MySQLConnection.ts#L170)
|
|
435
461
|
|
|
436
462
|
___
|
|
437
463
|
|
|
@@ -455,7 +481,7 @@ ___
|
|
|
455
481
|
|
|
456
482
|
#### Defined in
|
|
457
483
|
|
|
458
|
-
[src/DatabaseConnection.ts:63](https://github.com/breautek/storm/blob/
|
|
484
|
+
[src/DatabaseConnection.ts:63](https://github.com/breautek/storm/blob/306a47f/src/DatabaseConnection.ts#L63)
|
|
459
485
|
|
|
460
486
|
___
|
|
461
487
|
|
|
@@ -481,7 +507,7 @@ Sets the timeout of this connectino
|
|
|
481
507
|
|
|
482
508
|
#### Defined in
|
|
483
509
|
|
|
484
|
-
[src/DatabaseConnection.ts:108](https://github.com/breautek/storm/blob/
|
|
510
|
+
[src/DatabaseConnection.ts:108](https://github.com/breautek/storm/blob/306a47f/src/DatabaseConnection.ts#L108)
|
|
485
511
|
|
|
486
512
|
___
|
|
487
513
|
|
|
@@ -491,6 +517,10 @@ ___
|
|
|
491
517
|
|
|
492
518
|
Implementation method to start a transaction.
|
|
493
519
|
|
|
520
|
+
**`Abstract`**
|
|
521
|
+
|
|
522
|
+
**`Async`**
|
|
523
|
+
|
|
494
524
|
#### Returns
|
|
495
525
|
|
|
496
526
|
`Promise`<`void`\>
|
|
@@ -503,7 +533,7 @@ Promise<void>
|
|
|
503
533
|
|
|
504
534
|
#### Defined in
|
|
505
535
|
|
|
506
|
-
[src/MySQLConnection.ts:
|
|
536
|
+
[src/MySQLConnection.ts:144](https://github.com/breautek/storm/blob/306a47f/src/MySQLConnection.ts#L144)
|
|
507
537
|
|
|
508
538
|
___
|
|
509
539
|
|
|
@@ -530,4 +560,4 @@ Readable
|
|
|
530
560
|
|
|
531
561
|
#### Defined in
|
|
532
562
|
|
|
533
|
-
[src/DatabaseConnection.ts:151](https://github.com/breautek/storm/blob/
|
|
563
|
+
[src/DatabaseConnection.ts:151](https://github.com/breautek/storm/blob/306a47f/src/DatabaseConnection.ts#L151)
|