@breautek/storm 5.0.1 → 5.0.2
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 +10 -2
- package/docs/assets/highlight.css +85 -0
- package/docs/assets/main.js +58 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1367 -0
- package/docs/classes/Application.html +1235 -0
- package/docs/classes/BackendAuthenticationMiddleware.html +191 -0
- package/docs/classes/CORSMiddleware.html +257 -0
- package/docs/classes/ConfigLoader.html +166 -0
- package/docs/classes/Database.html +340 -0
- package/docs/classes/DatabaseCastObject.html +203 -0
- package/docs/classes/DatabaseConnection.html +550 -0
- package/docs/classes/DatabaseQueryError.html +372 -0
- package/docs/classes/DeadLockError.html +372 -0
- package/docs/classes/DiskSpaceError.html +362 -0
- package/docs/classes/DropTemporaryTableQuery.html +285 -0
- package/docs/classes/DumpStream.html +161 -0
- package/docs/classes/DuplicateEntryError.html +366 -0
- package/docs/classes/EntityNotFoundError.html +362 -0
- package/docs/classes/ExpiredTokenError.html +362 -0
- package/docs/classes/Handler.html +395 -0
- package/docs/classes/InternalError.html +362 -0
- package/docs/classes/InvalidCredentialsError.html +362 -0
- package/docs/classes/InvalidValueError.html +373 -0
- package/docs/classes/LineString.html +212 -0
- package/docs/classes/LockWaitTimeoutError.html +372 -0
- package/docs/classes/ManagedDatabaseConnection.html +410 -0
- package/docs/classes/Middleware.html +202 -0
- package/docs/classes/MissingConfigError.html +362 -0
- package/docs/classes/MissingParameterError.html +362 -0
- package/docs/classes/MySQLConnection.html +546 -0
- package/docs/classes/MySQLDatabase.html +353 -0
- package/docs/classes/NotImplementedError.html +362 -0
- package/docs/classes/Point.html +214 -0
- package/docs/classes/Polygon.html +212 -0
- package/docs/classes/Query.html +312 -0
- package/docs/classes/RawError.html +374 -0
- package/docs/classes/RawQuery.html +305 -0
- package/docs/classes/Request.html +375 -0
- package/docs/classes/Response.html +329 -0
- package/docs/classes/ResponseData.html +255 -0
- package/docs/classes/ServiceProvider.html +385 -0
- package/docs/classes/ServiceResponse.html +213 -0
- package/docs/classes/SetSessionVariableQuery.html +285 -0
- package/docs/classes/StormError.html +377 -0
- package/docs/classes/TemporaryTableQuery.html +290 -0
- package/docs/classes/Token.html +181 -0
- package/docs/classes/TokenManager.html +233 -0
- package/docs/classes/Transaction.html +267 -0
- package/docs/classes/UnauthorizedAccessError.html +362 -0
- package/docs/enums/ErrorCode.html +210 -0
- package/docs/enums/ExitCode.html +161 -0
- package/docs/enums/HTTPMethod.html +175 -0
- package/docs/enums/IsolationLevel.html +175 -0
- package/docs/enums/JWTError.html +161 -0
- package/docs/enums/StatusCode.html +483 -0
- package/docs/functions/formidable-1.html +143 -0
- package/docs/functions/getInstance.html +138 -0
- package/docs/index.html +224 -0
- package/docs/interfaces/IAdditionalErrorDetails.html +140 -0
- package/docs/interfaces/IAuthTokenData.html +172 -0
- package/docs/interfaces/IConfig.html +225 -0
- package/docs/interfaces/IDatabaseConfig.html +198 -0
- package/docs/interfaces/IDatabaseConnection.html +332 -0
- package/docs/interfaces/IErrorResponse.html +186 -0
- package/docs/interfaces/IFormData.html +165 -0
- package/docs/interfaces/IHandler.html +171 -0
- package/docs/interfaces/IInsertQueryResult.html +172 -0
- package/docs/interfaces/IJWTVerifyOptions.html +158 -0
- package/docs/interfaces/IParameterMap.html +140 -0
- package/docs/interfaces/IQueryable.html +233 -0
- package/docs/interfaces/IRequestResponse.html +172 -0
- package/docs/interfaces/IServiceHeaders.html +140 -0
- package/docs/interfaces/ISetSessionVariableQueryInput.html +165 -0
- package/docs/interfaces/ITemporaryTableQueryInput.html +165 -0
- package/docs/interfaces/IUpdateQueryResult.html +165 -0
- package/docs/interfaces/formidable.EmitData.html +180 -0
- package/docs/interfaces/formidable.EventData.html +201 -0
- package/docs/interfaces/formidable.Fields.html +141 -0
- package/docs/interfaces/formidable.File.html +239 -0
- package/docs/interfaces/formidable.FileJSON.html +238 -0
- package/docs/interfaces/formidable.Files.html +141 -0
- package/docs/interfaces/formidable.Options.html +308 -0
- package/docs/interfaces/formidable.Part.html +691 -0
- package/docs/modules/formidable.html +159 -0
- package/docs/types/IDeleteQueryResult.html +134 -0
- package/docs/types/IHandlerError.html +139 -0
- package/docs/types/IHandlerResponse.html +145 -0
- package/docs/types/TCoordinate.html +134 -0
- package/docs/types/formidable.BufferEncoding.html +135 -0
- package/docs/types/formidable.DefaultOptions.html +135 -0
- package/docs/types/formidable.EnabledPlugins.html +135 -0
- package/docs/types/formidable.EventNames.html +135 -0
- package/docs/types/formidable.MappedParsers.html +135 -0
- package/docs/types/formidable.Plugin.html +135 -0
- package/docs/types/formidable.PluginFunction.html +150 -0
- package/docs/types/formidable.Plugins.html +135 -0
- package/lib/StatusCode.d.ts +1 -1
- package/lib/StatusCode.js +1 -1
- package/lib/Transaction.d.ts +4 -0
- package/lib/Transaction.js +4 -0
- package/lib/Transaction.js.map +1 -1
- package/package.json +14 -14
- package/src/StatusCode.ts +1 -1
- package/src/Transaction.ts +4 -0
- package/docs/README.md +0 -188
- package/docs/classes/Application.md +0 -1648
- package/docs/classes/BackendAuthenticationMiddleware.md +0 -49
- package/docs/classes/CORSMiddleware.md +0 -143
- package/docs/classes/ConfigLoader.md +0 -29
- package/docs/classes/Database.md +0 -259
- package/docs/classes/DatabaseCastObject.md +0 -79
- package/docs/classes/DatabaseConnection.md +0 -556
- package/docs/classes/DatabaseQueryError.md +0 -351
- package/docs/classes/DeadLockError.md +0 -349
- package/docs/classes/DiskSpaceError.md +0 -341
- package/docs/classes/DropTemporaryTableQuery.md +0 -207
- package/docs/classes/DumpStream.md +0 -23
- package/docs/classes/DuplicateEntryError.md +0 -343
- package/docs/classes/EntityNotFoundError.md +0 -341
- package/docs/classes/ExpiredTokenError.md +0 -341
- package/docs/classes/Handler.md +0 -302
- package/docs/classes/InternalError.md +0 -341
- package/docs/classes/InvalidCredentialsError.md +0 -341
- package/docs/classes/InvalidValueError.md +0 -349
- package/docs/classes/LineString.md +0 -101
- package/docs/classes/LockWaitTimeoutError.md +0 -349
- package/docs/classes/ManagedDatabaseConnection.md +0 -403
- package/docs/classes/Middleware.md +0 -72
- package/docs/classes/MissingConfigError.md +0 -341
- package/docs/classes/MissingParameterError.md +0 -341
- package/docs/classes/MySQLConnection.md +0 -569
- package/docs/classes/MySQLDatabase.md +0 -314
- package/docs/classes/NotImplementedError.md +0 -341
- package/docs/classes/Point.md +0 -102
- package/docs/classes/Polygon.md +0 -101
- package/docs/classes/Query.md +0 -227
- package/docs/classes/RawError.md +0 -351
- package/docs/classes/RawQuery.md +0 -224
- package/docs/classes/Request.md +0 -321
- package/docs/classes/Response.md +0 -242
- package/docs/classes/ResponseData.md +0 -144
- package/docs/classes/ServiceProvider.md +0 -296
- package/docs/classes/ServiceResponse.md +0 -89
- package/docs/classes/SetSessionVariableQuery.md +0 -207
- package/docs/classes/StormError.md +0 -343
- package/docs/classes/TemporaryTableQuery.md +0 -213
- package/docs/classes/Token.md +0 -43
- package/docs/classes/TokenManager.md +0 -105
- package/docs/classes/Transaction.md +0 -161
- package/docs/classes/UnauthorizedAccessError.md +0 -341
- package/docs/enums/ErrorCode.md +0 -107
- package/docs/enums/ExitCode.md +0 -30
- package/docs/enums/HTTPMethod.md +0 -52
- package/docs/enums/IsolationLevel.md +0 -52
- package/docs/enums/JWTError.md +0 -30
- package/docs/enums/StatusCode.md +0 -536
- package/docs/interfaces/IAdditionalErrorDetails.md +0 -7
- package/docs/interfaces/IAuthTokenData.md +0 -41
- package/docs/interfaces/IConfig.md +0 -112
- package/docs/interfaces/IDatabaseConfig.md +0 -80
- package/docs/interfaces/IDatabaseConnection.md +0 -262
- package/docs/interfaces/IErrorResponse.md +0 -63
- package/docs/interfaces/IFormData.md +0 -30
- package/docs/interfaces/IHandler.md +0 -31
- package/docs/interfaces/IInsertQueryResult.md +0 -41
- package/docs/interfaces/IJWTVerifyOptions.md +0 -19
- package/docs/interfaces/IParameterMap.md +0 -7
- package/docs/interfaces/IQueryable.md +0 -119
- package/docs/interfaces/IRequestResponse.md +0 -37
- package/docs/interfaces/IServiceHeaders.md +0 -7
- package/docs/interfaces/ISetSessionVariableQueryInput.md +0 -30
- package/docs/interfaces/ITemporaryTableQueryInput.md +0 -30
- package/docs/interfaces/IUpdateQueryResult.md +0 -30
- package/docs/interfaces/formidable.EmitData.md +0 -54
- package/docs/interfaces/formidable.EventData.md +0 -87
- package/docs/interfaces/formidable.Fields.md +0 -9
- package/docs/interfaces/formidable.File.md +0 -131
- package/docs/interfaces/formidable.FileJSON.md +0 -151
- package/docs/interfaces/formidable.Files.md +0 -9
- package/docs/interfaces/formidable.Options.md +0 -225
- package/docs/interfaces/formidable.Part.md +0 -793
- package/docs/modules/formidable.md +0 -122
|
@@ -1,556 +0,0 @@
|
|
|
1
|
-
[@breautek/storm](../README.md) / DatabaseConnection
|
|
2
|
-
|
|
3
|
-
# Class: DatabaseConnection<TAPI\>
|
|
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
|
-
|
|
13
|
-
## Type parameters
|
|
14
|
-
|
|
15
|
-
| Name |
|
|
16
|
-
| :------ |
|
|
17
|
-
| `TAPI` |
|
|
18
|
-
|
|
19
|
-
## Hierarchy
|
|
20
|
-
|
|
21
|
-
- **`DatabaseConnection`**
|
|
22
|
-
|
|
23
|
-
↳ [`MySQLConnection`](MySQLConnection.md)
|
|
24
|
-
|
|
25
|
-
## Implements
|
|
26
|
-
|
|
27
|
-
- [`IDatabaseConnection`](../interfaces/IDatabaseConnection.md)
|
|
28
|
-
|
|
29
|
-
## Table of contents
|
|
30
|
-
|
|
31
|
-
### Constructors
|
|
32
|
-
|
|
33
|
-
- [constructor](DatabaseConnection.md#constructor)
|
|
34
|
-
|
|
35
|
-
### Methods
|
|
36
|
-
|
|
37
|
-
- [\_close](DatabaseConnection.md#_close)
|
|
38
|
-
- [\_query](DatabaseConnection.md#_query)
|
|
39
|
-
- [\_stream](DatabaseConnection.md#_stream)
|
|
40
|
-
- [close](DatabaseConnection.md#close)
|
|
41
|
-
- [commit](DatabaseConnection.md#commit)
|
|
42
|
-
- [endTransaction](DatabaseConnection.md#endtransaction)
|
|
43
|
-
- [getAPI](DatabaseConnection.md#getapi)
|
|
44
|
-
- [getInstantiationStack](DatabaseConnection.md#getinstantiationstack)
|
|
45
|
-
- [getTimeout](DatabaseConnection.md#gettimeout)
|
|
46
|
-
- [isClosed](DatabaseConnection.md#isclosed)
|
|
47
|
-
- [isReadOnly](DatabaseConnection.md#isreadonly)
|
|
48
|
-
- [isTransaction](DatabaseConnection.md#istransaction)
|
|
49
|
-
- [query](DatabaseConnection.md#query)
|
|
50
|
-
- [rollback](DatabaseConnection.md#rollback)
|
|
51
|
-
- [setInstantiationStack](DatabaseConnection.md#setinstantiationstack)
|
|
52
|
-
- [setTimeout](DatabaseConnection.md#settimeout)
|
|
53
|
-
- [startTransaction](DatabaseConnection.md#starttransaction)
|
|
54
|
-
- [stream](DatabaseConnection.md#stream)
|
|
55
|
-
|
|
56
|
-
## Constructors
|
|
57
|
-
|
|
58
|
-
### constructor
|
|
59
|
-
|
|
60
|
-
• **new DatabaseConnection**<`TAPI`\>(`api`, `isReadOnly`, `instantiationStack`)
|
|
61
|
-
|
|
62
|
-
#### Type parameters
|
|
63
|
-
|
|
64
|
-
| Name |
|
|
65
|
-
| :------ |
|
|
66
|
-
| `TAPI` |
|
|
67
|
-
|
|
68
|
-
#### Parameters
|
|
69
|
-
|
|
70
|
-
| Name | Type |
|
|
71
|
-
| :------ | :------ |
|
|
72
|
-
| `api` | `TAPI` |
|
|
73
|
-
| `isReadOnly` | `boolean` |
|
|
74
|
-
| `instantiationStack` | `string` |
|
|
75
|
-
|
|
76
|
-
#### Defined in
|
|
77
|
-
|
|
78
|
-
[src/DatabaseConnection.ts:44](https://github.com/breautek/storm/blob/3dcafe4/src/DatabaseConnection.ts#L44)
|
|
79
|
-
|
|
80
|
-
## Methods
|
|
81
|
-
|
|
82
|
-
### \_close
|
|
83
|
-
|
|
84
|
-
▸ `Protected` `Abstract` **_close**(`forceClose`): `Promise`<`void`\>
|
|
85
|
-
|
|
86
|
-
Implementation to close the connection, if `forceClose` is true, close the connection no matter what.
|
|
87
|
-
Silently error if it means the connection is closed.
|
|
88
|
-
|
|
89
|
-
**`Async`**
|
|
90
|
-
|
|
91
|
-
#### Parameters
|
|
92
|
-
|
|
93
|
-
| Name | Type | Description |
|
|
94
|
-
| :------ | :------ | :------ |
|
|
95
|
-
| `forceClose` | `boolean` | boolean, if `true`, should close the connection no matter what. |
|
|
96
|
-
|
|
97
|
-
#### Returns
|
|
98
|
-
|
|
99
|
-
`Promise`<`void`\>
|
|
100
|
-
|
|
101
|
-
Promise<void>
|
|
102
|
-
|
|
103
|
-
#### Defined in
|
|
104
|
-
|
|
105
|
-
[src/DatabaseConnection.ts:239](https://github.com/breautek/storm/blob/3dcafe4/src/DatabaseConnection.ts#L239)
|
|
106
|
-
|
|
107
|
-
___
|
|
108
|
-
|
|
109
|
-
### \_query
|
|
110
|
-
|
|
111
|
-
▸ `Protected` `Abstract` **_query**<`TQueryResult`\>(`query`, `params?`): `Promise`<`TQueryResult`\>
|
|
112
|
-
|
|
113
|
-
Implementation method to return a dataset from the database
|
|
114
|
-
|
|
115
|
-
**`Async`**
|
|
116
|
-
|
|
117
|
-
#### Type parameters
|
|
118
|
-
|
|
119
|
-
| Name |
|
|
120
|
-
| :------ |
|
|
121
|
-
| `TQueryResult` |
|
|
122
|
-
|
|
123
|
-
#### Parameters
|
|
124
|
-
|
|
125
|
-
| Name | Type | Description |
|
|
126
|
-
| :------ | :------ | :------ |
|
|
127
|
-
| `query` | `string` | The database query |
|
|
128
|
-
| `params?` | `any` | The query parameters |
|
|
129
|
-
|
|
130
|
-
#### Returns
|
|
131
|
-
|
|
132
|
-
`Promise`<`TQueryResult`\>
|
|
133
|
-
|
|
134
|
-
Promise
|
|
135
|
-
|
|
136
|
-
#### Defined in
|
|
137
|
-
|
|
138
|
-
[src/DatabaseConnection.ts:250](https://github.com/breautek/storm/blob/3dcafe4/src/DatabaseConnection.ts#L250)
|
|
139
|
-
|
|
140
|
-
___
|
|
141
|
-
|
|
142
|
-
### \_stream
|
|
143
|
-
|
|
144
|
-
▸ `Protected` `Abstract` **_stream**(`query`, `params?`, `streamOptions?`): `Readable`
|
|
145
|
-
|
|
146
|
-
Implementation method to return a dataset from the database like `query()`,
|
|
147
|
-
but returns a `Readable` stream instead.
|
|
148
|
-
|
|
149
|
-
#### Parameters
|
|
150
|
-
|
|
151
|
-
| Name | Type | Description |
|
|
152
|
-
| :------ | :------ | :------ |
|
|
153
|
-
| `query` | `string` | The database query |
|
|
154
|
-
| `params?` | `any` | The query parameters |
|
|
155
|
-
| `streamOptions?` | `any` | `Readable` stream options |
|
|
156
|
-
|
|
157
|
-
#### Returns
|
|
158
|
-
|
|
159
|
-
`Readable`
|
|
160
|
-
|
|
161
|
-
`Readable`
|
|
162
|
-
|
|
163
|
-
#### Defined in
|
|
164
|
-
|
|
165
|
-
[src/DatabaseConnection.ts:262](https://github.com/breautek/storm/blob/3dcafe4/src/DatabaseConnection.ts#L262)
|
|
166
|
-
|
|
167
|
-
___
|
|
168
|
-
|
|
169
|
-
### close
|
|
170
|
-
|
|
171
|
-
▸ **close**(`forceClose?`): `Promise`<`void`\>
|
|
172
|
-
|
|
173
|
-
Closes the connection. May error if connection has an active transaction.
|
|
174
|
-
if `forceClose` boolean is true, it will force close the connection, regardless
|
|
175
|
-
of transaction state.
|
|
176
|
-
|
|
177
|
-
**`Async`**
|
|
178
|
-
|
|
179
|
-
#### Parameters
|
|
180
|
-
|
|
181
|
-
| Name | Type | Default value | Description |
|
|
182
|
-
| :------ | :------ | :------ | :------ |
|
|
183
|
-
| `forceClose` | `boolean` | `false` | optional boolean |
|
|
184
|
-
|
|
185
|
-
#### Returns
|
|
186
|
-
|
|
187
|
-
`Promise`<`void`\>
|
|
188
|
-
|
|
189
|
-
Promise<void>
|
|
190
|
-
|
|
191
|
-
#### Implementation of
|
|
192
|
-
|
|
193
|
-
[IDatabaseConnection](../interfaces/IDatabaseConnection.md).[close](../interfaces/IDatabaseConnection.md#close)
|
|
194
|
-
|
|
195
|
-
#### Defined in
|
|
196
|
-
|
|
197
|
-
[src/DatabaseConnection.ts:169](https://github.com/breautek/storm/blob/3dcafe4/src/DatabaseConnection.ts#L169)
|
|
198
|
-
|
|
199
|
-
___
|
|
200
|
-
|
|
201
|
-
### commit
|
|
202
|
-
|
|
203
|
-
▸ `Abstract` **commit**(): `Promise`<`void`\>
|
|
204
|
-
|
|
205
|
-
Commits a transaction. This will end a transaction.
|
|
206
|
-
|
|
207
|
-
**`Abstract`**
|
|
208
|
-
|
|
209
|
-
**`Async`**
|
|
210
|
-
|
|
211
|
-
#### Returns
|
|
212
|
-
|
|
213
|
-
`Promise`<`void`\>
|
|
214
|
-
|
|
215
|
-
Promise<void>
|
|
216
|
-
|
|
217
|
-
#### Implementation of
|
|
218
|
-
|
|
219
|
-
[IDatabaseConnection](../interfaces/IDatabaseConnection.md).[commit](../interfaces/IDatabaseConnection.md#commit)
|
|
220
|
-
|
|
221
|
-
#### Defined in
|
|
222
|
-
|
|
223
|
-
[src/DatabaseConnection.ts:220](https://github.com/breautek/storm/blob/3dcafe4/src/DatabaseConnection.ts#L220)
|
|
224
|
-
|
|
225
|
-
___
|
|
226
|
-
|
|
227
|
-
### endTransaction
|
|
228
|
-
|
|
229
|
-
▸ `Abstract` **endTransaction**(`requiresRollback?`): `Promise`<`void`\>
|
|
230
|
-
|
|
231
|
-
Ends a transaction. if `requiresRollback` is `true`, then `rollback()` is invoked. Otherwise, `commit()` is invoked.
|
|
232
|
-
|
|
233
|
-
**`Abstract`**
|
|
234
|
-
|
|
235
|
-
**`Async`**
|
|
236
|
-
|
|
237
|
-
#### Parameters
|
|
238
|
-
|
|
239
|
-
| Name | Type | Description |
|
|
240
|
-
| :------ | :------ | :------ |
|
|
241
|
-
| `requiresRollback?` | `boolean` | optional boolean |
|
|
242
|
-
|
|
243
|
-
#### Returns
|
|
244
|
-
|
|
245
|
-
`Promise`<`void`\>
|
|
246
|
-
|
|
247
|
-
Promise<void>
|
|
248
|
-
|
|
249
|
-
#### Defined in
|
|
250
|
-
|
|
251
|
-
[src/DatabaseConnection.ts:211](https://github.com/breautek/storm/blob/3dcafe4/src/DatabaseConnection.ts#L211)
|
|
252
|
-
|
|
253
|
-
___
|
|
254
|
-
|
|
255
|
-
### getAPI
|
|
256
|
-
|
|
257
|
-
▸ **getAPI**(): `TAPI`
|
|
258
|
-
|
|
259
|
-
Gets the underlying Database API
|
|
260
|
-
|
|
261
|
-
#### Returns
|
|
262
|
-
|
|
263
|
-
`TAPI`
|
|
264
|
-
|
|
265
|
-
any
|
|
266
|
-
|
|
267
|
-
#### Implementation of
|
|
268
|
-
|
|
269
|
-
[IDatabaseConnection](../interfaces/IDatabaseConnection.md).[getAPI](../interfaces/IDatabaseConnection.md#getapi)
|
|
270
|
-
|
|
271
|
-
#### Defined in
|
|
272
|
-
|
|
273
|
-
[src/DatabaseConnection.ts:91](https://github.com/breautek/storm/blob/3dcafe4/src/DatabaseConnection.ts#L91)
|
|
274
|
-
|
|
275
|
-
___
|
|
276
|
-
|
|
277
|
-
### getInstantiationStack
|
|
278
|
-
|
|
279
|
-
▸ **getInstantiationStack**(): `string`
|
|
280
|
-
|
|
281
|
-
Gets the callback stacktrace to determine what opened
|
|
282
|
-
this connection. Useful for debugging lingering connections.
|
|
283
|
-
|
|
284
|
-
#### Returns
|
|
285
|
-
|
|
286
|
-
`string`
|
|
287
|
-
|
|
288
|
-
string - A stacktrace
|
|
289
|
-
|
|
290
|
-
#### Implementation of
|
|
291
|
-
|
|
292
|
-
[IDatabaseConnection](../interfaces/IDatabaseConnection.md).[getInstantiationStack](../interfaces/IDatabaseConnection.md#getinstantiationstack)
|
|
293
|
-
|
|
294
|
-
#### Defined in
|
|
295
|
-
|
|
296
|
-
[src/DatabaseConnection.ts:73](https://github.com/breautek/storm/blob/3dcafe4/src/DatabaseConnection.ts#L73)
|
|
297
|
-
|
|
298
|
-
___
|
|
299
|
-
|
|
300
|
-
### getTimeout
|
|
301
|
-
|
|
302
|
-
▸ **getTimeout**(): `number`
|
|
303
|
-
|
|
304
|
-
Returns the current timeout setting
|
|
305
|
-
|
|
306
|
-
#### Returns
|
|
307
|
-
|
|
308
|
-
`number`
|
|
309
|
-
|
|
310
|
-
number in milliseconds
|
|
311
|
-
|
|
312
|
-
#### Implementation of
|
|
313
|
-
|
|
314
|
-
[IDatabaseConnection](../interfaces/IDatabaseConnection.md).[getTimeout](../interfaces/IDatabaseConnection.md#gettimeout)
|
|
315
|
-
|
|
316
|
-
#### Defined in
|
|
317
|
-
|
|
318
|
-
[src/DatabaseConnection.ts:121](https://github.com/breautek/storm/blob/3dcafe4/src/DatabaseConnection.ts#L121)
|
|
319
|
-
|
|
320
|
-
___
|
|
321
|
-
|
|
322
|
-
### isClosed
|
|
323
|
-
|
|
324
|
-
▸ **isClosed**(): `boolean`
|
|
325
|
-
|
|
326
|
-
Returns true if the connection has been closed.
|
|
327
|
-
|
|
328
|
-
#### Returns
|
|
329
|
-
|
|
330
|
-
`boolean`
|
|
331
|
-
|
|
332
|
-
#### Implementation of
|
|
333
|
-
|
|
334
|
-
[IDatabaseConnection](../interfaces/IDatabaseConnection.md).[isClosed](../interfaces/IDatabaseConnection.md#isclosed)
|
|
335
|
-
|
|
336
|
-
#### Defined in
|
|
337
|
-
|
|
338
|
-
[src/DatabaseConnection.ts:182](https://github.com/breautek/storm/blob/3dcafe4/src/DatabaseConnection.ts#L182)
|
|
339
|
-
|
|
340
|
-
___
|
|
341
|
-
|
|
342
|
-
### isReadOnly
|
|
343
|
-
|
|
344
|
-
▸ **isReadOnly**(): `boolean`
|
|
345
|
-
|
|
346
|
-
Returns true if connection was created without
|
|
347
|
-
write access
|
|
348
|
-
|
|
349
|
-
#### Returns
|
|
350
|
-
|
|
351
|
-
`boolean`
|
|
352
|
-
|
|
353
|
-
boolean
|
|
354
|
-
|
|
355
|
-
#### Implementation of
|
|
356
|
-
|
|
357
|
-
[IDatabaseConnection](../interfaces/IDatabaseConnection.md).[isReadOnly](../interfaces/IDatabaseConnection.md#isreadonly)
|
|
358
|
-
|
|
359
|
-
#### Defined in
|
|
360
|
-
|
|
361
|
-
[src/DatabaseConnection.ts:100](https://github.com/breautek/storm/blob/3dcafe4/src/DatabaseConnection.ts#L100)
|
|
362
|
-
|
|
363
|
-
___
|
|
364
|
-
|
|
365
|
-
### isTransaction
|
|
366
|
-
|
|
367
|
-
▸ `Abstract` **isTransaction**(): `boolean`
|
|
368
|
-
|
|
369
|
-
Implementation method to determine if the connection is in an active transaction.
|
|
370
|
-
|
|
371
|
-
**`Abstract`**
|
|
372
|
-
|
|
373
|
-
#### Returns
|
|
374
|
-
|
|
375
|
-
`boolean`
|
|
376
|
-
|
|
377
|
-
boolean
|
|
378
|
-
|
|
379
|
-
#### Implementation of
|
|
380
|
-
|
|
381
|
-
[IDatabaseConnection](../interfaces/IDatabaseConnection.md).[isTransaction](../interfaces/IDatabaseConnection.md#istransaction)
|
|
382
|
-
|
|
383
|
-
#### Defined in
|
|
384
|
-
|
|
385
|
-
[src/DatabaseConnection.ts:201](https://github.com/breautek/storm/blob/3dcafe4/src/DatabaseConnection.ts#L201)
|
|
386
|
-
|
|
387
|
-
___
|
|
388
|
-
|
|
389
|
-
### query
|
|
390
|
-
|
|
391
|
-
▸ **query**<`TQueryResult`\>(`query`): `Promise`<`TQueryResult`\>
|
|
392
|
-
|
|
393
|
-
Queries the database for a dataset.
|
|
394
|
-
|
|
395
|
-
**`Async`**
|
|
396
|
-
|
|
397
|
-
#### Type parameters
|
|
398
|
-
|
|
399
|
-
| Name | Type |
|
|
400
|
-
| :------ | :------ |
|
|
401
|
-
| `TQueryResult` | `any` |
|
|
402
|
-
|
|
403
|
-
#### Parameters
|
|
404
|
-
|
|
405
|
-
| Name | Type | Description |
|
|
406
|
-
| :------ | :------ | :------ |
|
|
407
|
-
| `query` | [`IQueryable`](../interfaces/IQueryable.md)<`TQueryResult`\> | The database query |
|
|
408
|
-
|
|
409
|
-
#### Returns
|
|
410
|
-
|
|
411
|
-
`Promise`<`TQueryResult`\>
|
|
412
|
-
|
|
413
|
-
Promise<TQueryResult>
|
|
414
|
-
|
|
415
|
-
#### Implementation of
|
|
416
|
-
|
|
417
|
-
[IDatabaseConnection](../interfaces/IDatabaseConnection.md).[query](../interfaces/IDatabaseConnection.md#query)
|
|
418
|
-
|
|
419
|
-
#### Defined in
|
|
420
|
-
|
|
421
|
-
[src/DatabaseConnection.ts:132](https://github.com/breautek/storm/blob/3dcafe4/src/DatabaseConnection.ts#L132)
|
|
422
|
-
|
|
423
|
-
___
|
|
424
|
-
|
|
425
|
-
### rollback
|
|
426
|
-
|
|
427
|
-
▸ `Abstract` **rollback**(): `Promise`<`void`\>
|
|
428
|
-
|
|
429
|
-
Rollsback a transaction. This will end a transaction.
|
|
430
|
-
|
|
431
|
-
**`Abstract`**
|
|
432
|
-
|
|
433
|
-
**`Async`**
|
|
434
|
-
|
|
435
|
-
#### Returns
|
|
436
|
-
|
|
437
|
-
`Promise`<`void`\>
|
|
438
|
-
|
|
439
|
-
Promise<void>
|
|
440
|
-
|
|
441
|
-
#### Implementation of
|
|
442
|
-
|
|
443
|
-
[IDatabaseConnection](../interfaces/IDatabaseConnection.md).[rollback](../interfaces/IDatabaseConnection.md#rollback)
|
|
444
|
-
|
|
445
|
-
#### Defined in
|
|
446
|
-
|
|
447
|
-
[src/DatabaseConnection.ts:229](https://github.com/breautek/storm/blob/3dcafe4/src/DatabaseConnection.ts#L229)
|
|
448
|
-
|
|
449
|
-
___
|
|
450
|
-
|
|
451
|
-
### setInstantiationStack
|
|
452
|
-
|
|
453
|
-
▸ **setInstantiationStack**(`stack`): `void`
|
|
454
|
-
|
|
455
|
-
#### Parameters
|
|
456
|
-
|
|
457
|
-
| Name | Type |
|
|
458
|
-
| :------ | :------ |
|
|
459
|
-
| `stack` | `string` |
|
|
460
|
-
|
|
461
|
-
#### Returns
|
|
462
|
-
|
|
463
|
-
`void`
|
|
464
|
-
|
|
465
|
-
#### Implementation of
|
|
466
|
-
|
|
467
|
-
[IDatabaseConnection](../interfaces/IDatabaseConnection.md).[setInstantiationStack](../interfaces/IDatabaseConnection.md#setinstantiationstack)
|
|
468
|
-
|
|
469
|
-
#### Defined in
|
|
470
|
-
|
|
471
|
-
[src/DatabaseConnection.ts:64](https://github.com/breautek/storm/blob/3dcafe4/src/DatabaseConnection.ts#L64)
|
|
472
|
-
|
|
473
|
-
___
|
|
474
|
-
|
|
475
|
-
### setTimeout
|
|
476
|
-
|
|
477
|
-
▸ **setTimeout**(`timeout`): `void`
|
|
478
|
-
|
|
479
|
-
Sets the timeout of this connectino
|
|
480
|
-
|
|
481
|
-
#### Parameters
|
|
482
|
-
|
|
483
|
-
| Name | Type | Description |
|
|
484
|
-
| :------ | :------ | :------ |
|
|
485
|
-
| `timeout` | `number` | in milliseconds |
|
|
486
|
-
|
|
487
|
-
#### Returns
|
|
488
|
-
|
|
489
|
-
`void`
|
|
490
|
-
|
|
491
|
-
#### Implementation of
|
|
492
|
-
|
|
493
|
-
[IDatabaseConnection](../interfaces/IDatabaseConnection.md).[setTimeout](../interfaces/IDatabaseConnection.md#settimeout)
|
|
494
|
-
|
|
495
|
-
#### Defined in
|
|
496
|
-
|
|
497
|
-
[src/DatabaseConnection.ts:109](https://github.com/breautek/storm/blob/3dcafe4/src/DatabaseConnection.ts#L109)
|
|
498
|
-
|
|
499
|
-
___
|
|
500
|
-
|
|
501
|
-
### startTransaction
|
|
502
|
-
|
|
503
|
-
▸ `Abstract` **startTransaction**(`isolationLevel?`): `Promise`<`void`\>
|
|
504
|
-
|
|
505
|
-
Implementation method to start a transaction.
|
|
506
|
-
|
|
507
|
-
**`Abstract`**
|
|
508
|
-
|
|
509
|
-
**`Async`**
|
|
510
|
-
|
|
511
|
-
#### Parameters
|
|
512
|
-
|
|
513
|
-
| Name | Type |
|
|
514
|
-
| :------ | :------ |
|
|
515
|
-
| `isolationLevel?` | [`IsolationLevel`](../enums/IsolationLevel.md) |
|
|
516
|
-
|
|
517
|
-
#### Returns
|
|
518
|
-
|
|
519
|
-
`Promise`<`void`\>
|
|
520
|
-
|
|
521
|
-
Promise<void>
|
|
522
|
-
|
|
523
|
-
#### Implementation of
|
|
524
|
-
|
|
525
|
-
[IDatabaseConnection](../interfaces/IDatabaseConnection.md).[startTransaction](../interfaces/IDatabaseConnection.md#starttransaction)
|
|
526
|
-
|
|
527
|
-
#### Defined in
|
|
528
|
-
|
|
529
|
-
[src/DatabaseConnection.ts:193](https://github.com/breautek/storm/blob/3dcafe4/src/DatabaseConnection.ts#L193)
|
|
530
|
-
|
|
531
|
-
___
|
|
532
|
-
|
|
533
|
-
### stream
|
|
534
|
-
|
|
535
|
-
▸ **stream**(`query`, `streamOptions?`): `Readable`
|
|
536
|
-
|
|
537
|
-
#### Parameters
|
|
538
|
-
|
|
539
|
-
| Name | Type | Description |
|
|
540
|
-
| :------ | :------ | :------ |
|
|
541
|
-
| `query` | [`IQueryable`](../interfaces/IQueryable.md)<`any`\> | The database query |
|
|
542
|
-
| `streamOptions?` | `any` | Stream options |
|
|
543
|
-
|
|
544
|
-
#### Returns
|
|
545
|
-
|
|
546
|
-
`Readable`
|
|
547
|
-
|
|
548
|
-
Readable
|
|
549
|
-
|
|
550
|
-
#### Implementation of
|
|
551
|
-
|
|
552
|
-
[IDatabaseConnection](../interfaces/IDatabaseConnection.md).[stream](../interfaces/IDatabaseConnection.md#stream)
|
|
553
|
-
|
|
554
|
-
#### Defined in
|
|
555
|
-
|
|
556
|
-
[src/DatabaseConnection.ts:152](https://github.com/breautek/storm/blob/3dcafe4/src/DatabaseConnection.ts#L152)
|