mssql 8.0.1 → 8.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.txt +10 -0
- package/lib/base/prepared-statement.js +4 -0
- package/lib/base/request.js +13 -11
- package/lib/base/transaction.js +4 -0
- package/package.json +1 -1
package/CHANGELOG.txt
CHANGED
|
@@ -11,6 +11,11 @@ v8.0.0 (2022-01-30)
|
|
|
11
11
|
[removed] Remove connection string parser helpers ((#1342)[https://github.com/tediousjs/node-mssql/pull/1342])
|
|
12
12
|
[removed] Remove deprecated pool properties ((#1359)[https://github.com/tediousjs/node-mssql/pull/1359])
|
|
13
13
|
|
|
14
|
+
v7.3.0 (2021-11-18)
|
|
15
|
+
-------------------
|
|
16
|
+
[new] Transaction/PreparedStatements expose the config from their parent connection
|
|
17
|
+
[fix] Fix inherited request configs from the pool. Specifically stream and arrayRowMode now inherit accurately from the connection config ([#1338](https://github.com/tediousjs/node-mssql/pull/1338))
|
|
18
|
+
|
|
14
19
|
v7.2.1 (2021-08-19)
|
|
15
20
|
-------------------
|
|
16
21
|
[fix] Fix issue with bulk insert of dates ((#1298)[https://github.com/tediousjs/node-mssql/pull/1298])
|
|
@@ -57,6 +62,11 @@ v7.0.0 (2021-05-06)
|
|
|
57
62
|
[fix] Connection config objects are now deep cloned when stored against a connection pool ([#1217](https://github.com/tediousjs/node-mssql/pull/1217))
|
|
58
63
|
[removed] Support for connection uri format has been removed (eg: `mssql://user:password@host/?params=values`)
|
|
59
64
|
|
|
65
|
+
v6.4.0 (2021-11-18)
|
|
66
|
+
-------------------
|
|
67
|
+
[new] Transaction/PreparedStatements expose the config from their parent connection
|
|
68
|
+
[fix] Fix inherited request configs from the pool. Specifically stream and arrayRowMode now inherit accurately from the connection config ([#1338](https://github.com/tediousjs/node-mssql/pull/1338))
|
|
69
|
+
|
|
60
70
|
v6.3.2 (2021-05-13)
|
|
61
71
|
-------------------
|
|
62
72
|
[fix] Bump various dependencies for security fixes
|
package/lib/base/request.js
CHANGED
|
@@ -26,7 +26,7 @@ class Request extends EventEmitter {
|
|
|
26
26
|
/**
|
|
27
27
|
* Create new Request.
|
|
28
28
|
*
|
|
29
|
-
* @param {Connection|ConnectionPool|Transaction|PreparedStatement} parent If
|
|
29
|
+
* @param {Connection|ConnectionPool|Transaction|PreparedStatement} parent If omitted, global connection is used instead.
|
|
30
30
|
*/
|
|
31
31
|
|
|
32
32
|
constructor (parent) {
|
|
@@ -39,6 +39,8 @@ class Request extends EventEmitter {
|
|
|
39
39
|
this._paused = false
|
|
40
40
|
this.parent = parent || globalConnection.pool
|
|
41
41
|
this.parameters = {}
|
|
42
|
+
this.stream = null
|
|
43
|
+
this.arrayRowMode = null
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
get paused () {
|
|
@@ -224,8 +226,8 @@ class Request extends EventEmitter {
|
|
|
224
226
|
*/
|
|
225
227
|
|
|
226
228
|
batch (batch, callback) {
|
|
227
|
-
if (this.stream
|
|
228
|
-
if (this.arrayRowMode
|
|
229
|
+
if (this.stream === null && this.parent) this.stream = this.parent.config.stream
|
|
230
|
+
if (this.arrayRowMode === null && this.parent) this.arrayRowMode = this.parent.config.arrayRowMode
|
|
229
231
|
this.rowsAffected = 0
|
|
230
232
|
|
|
231
233
|
if (typeof callback === 'function') {
|
|
@@ -288,11 +290,11 @@ class Request extends EventEmitter {
|
|
|
288
290
|
*/
|
|
289
291
|
|
|
290
292
|
_batch (batch, callback) {
|
|
291
|
-
if (!this.
|
|
293
|
+
if (!this.parent) {
|
|
292
294
|
return setImmediate(callback, new RequestError('No connection is specified for that request.', 'ENOCONN'))
|
|
293
295
|
}
|
|
294
296
|
|
|
295
|
-
if (!this.
|
|
297
|
+
if (!this.parent.connected) {
|
|
296
298
|
return setImmediate(callback, new ConnectionError('Connection is closed.', 'ECONNCLOSED'))
|
|
297
299
|
}
|
|
298
300
|
|
|
@@ -317,8 +319,8 @@ class Request extends EventEmitter {
|
|
|
317
319
|
options = {}
|
|
318
320
|
}
|
|
319
321
|
|
|
320
|
-
if (this.stream
|
|
321
|
-
if (this.arrayRowMode
|
|
322
|
+
if (this.stream === null && this.parent) this.stream = this.parent.config.stream
|
|
323
|
+
if (this.arrayRowMode === null && this.parent) this.arrayRowMode = this.parent.config.arrayRowMode
|
|
322
324
|
|
|
323
325
|
if (this.stream || typeof callback === 'function') {
|
|
324
326
|
this._bulk(table, options, (err, rowsAffected) => {
|
|
@@ -419,8 +421,8 @@ class Request extends EventEmitter {
|
|
|
419
421
|
*/
|
|
420
422
|
|
|
421
423
|
query (command, callback) {
|
|
422
|
-
if (this.stream
|
|
423
|
-
if (this.arrayRowMode
|
|
424
|
+
if (this.stream === null && this.parent) this.stream = this.parent.config.stream
|
|
425
|
+
if (this.arrayRowMode === null && this.parent) this.arrayRowMode = this.parent.config.arrayRowMode
|
|
424
426
|
this.rowsAffected = 0
|
|
425
427
|
|
|
426
428
|
if (typeof callback === 'function') {
|
|
@@ -508,8 +510,8 @@ class Request extends EventEmitter {
|
|
|
508
510
|
*/
|
|
509
511
|
|
|
510
512
|
execute (command, callback) {
|
|
511
|
-
if (this.stream
|
|
512
|
-
if (this.arrayRowMode
|
|
513
|
+
if (this.stream === null && this.parent) this.stream = this.parent.config.stream
|
|
514
|
+
if (this.arrayRowMode === null && this.parent) this.arrayRowMode = this.parent.config.arrayRowMode
|
|
513
515
|
this.rowsAffected = 0
|
|
514
516
|
|
|
515
517
|
if (typeof callback === 'function') {
|
package/lib/base/transaction.js
CHANGED