mssql 12.7.12 → 12.7.14
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 +5 -1
- package/lib/base/connection-pool.js +6 -1
- package/lib/msnodesqlv8/request.js +7 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
Supported TDS drivers:
|
|
8
8
|
|
|
9
9
|
- [Tedious][tedious-url] (pure JavaScript - Windows/macOS/Linux, default)
|
|
10
|
-
- [MSNodeSQLv8][msnodesqlv8-url] (Microsoft / Contributors Node V8 Driver for Node.js for SQL Server, v2-
|
|
10
|
+
- [MSNodeSQLv8][msnodesqlv8-url] (Microsoft / Contributors Node V8 Driver for Node.js for SQL Server, v2-v6 native - Windows or Linux/macOS 64 bits only)
|
|
11
11
|
|
|
12
12
|
## Installation
|
|
13
13
|
|
|
@@ -23,6 +23,8 @@ npm install mssql
|
|
|
23
23
|
npm install mssql msnodesqlv8
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
+
msnodesqlv8 6 needs Node.js 22 or later. On an older Node.js, install msnodesqlv8 5 (`npm install mssql msnodesqlv8@5`).
|
|
27
|
+
|
|
26
28
|
## SQL Server prerequisites
|
|
27
29
|
|
|
28
30
|
This package requires TCP/IP to connect to SQL Server, and you may need to enable this in your installation.
|
|
@@ -754,6 +756,8 @@ const sql = require('mssql/msnodesqlv8')
|
|
|
754
756
|
|
|
755
757
|
Note: If you use import into your lib to prepare your request (`const { VarChar } = require('mssql')`) you also need to upgrade all your types import into your code (`const { VarChar } = require('mssql/msnodesqlv8')`) or a `connection.on is not a function` error will be thrown.
|
|
756
758
|
|
|
759
|
+
msnodesqlv8 5 and earlier round `float` and `real` values, and `decimal` values with more than six decimal places, to six decimal places, output parameters included, so a value such as `1e-10` is read as `0`. `numeric`, `money` and `smallmoney` values are not affected. msnodesqlv8 6 reads them in full, as the tedious driver does; use its latest release.
|
|
760
|
+
|
|
757
761
|
|
|
758
762
|
**Extra options:**
|
|
759
763
|
|
|
@@ -421,7 +421,12 @@ class ConnectionPool extends EventEmitter {
|
|
|
421
421
|
return shared.Promise.reject(new ConnectionError('Connection is closing', 'ENOTOPEN'))
|
|
422
422
|
}
|
|
423
423
|
|
|
424
|
-
return this.pool.acquire().promise
|
|
424
|
+
return this.pool.acquire().promise.catch(err => {
|
|
425
|
+
if (err instanceof tarn.TimeoutError) {
|
|
426
|
+
err.message = `Failed to acquire a connection from the pool: ${err.message}`
|
|
427
|
+
}
|
|
428
|
+
throw err
|
|
429
|
+
})
|
|
425
430
|
}
|
|
426
431
|
|
|
427
432
|
/**
|
|
@@ -637,11 +637,16 @@ class Request extends BaseRequest {
|
|
|
637
637
|
return true
|
|
638
638
|
}
|
|
639
639
|
|
|
640
|
+
// msnodesqlv8 6 ends a cancelled query only if it was paused when the cancel went out, or is
|
|
641
|
+
// never paused after it: one paused after its cancel is held for good, and holds its
|
|
642
|
+
// connection. So once a cancel has gone out, and until it is refused, the query is not paused
|
|
643
|
+
const cancelSent = () => cancelRequested && typeof req.getCancelSent === 'function' && req.getCancelSent()
|
|
644
|
+
|
|
640
645
|
// called with each row once it is complete
|
|
641
646
|
const pauseDriverAtEndOfBatch = () => {
|
|
642
647
|
if (driverPaused || rowsInRecordset % DRIVER_ROW_BATCH_SIZE !== 0) return
|
|
643
648
|
if (cancelDeferred && pauseAndCancelDriver()) return
|
|
644
|
-
if (this.stream && this.paused) {
|
|
649
|
+
if (this.stream && this.paused && !cancelSent()) {
|
|
645
650
|
driverPaused = true
|
|
646
651
|
req.pauseQuery()
|
|
647
652
|
}
|
|
@@ -650,7 +655,7 @@ class Request extends BaseRequest {
|
|
|
650
655
|
// until the first result set the driver has read nothing, so a stream paused before then,
|
|
651
656
|
// or before its query starts, holds it back at once
|
|
652
657
|
this._pauseStream = () => {
|
|
653
|
-
if (!columns && !driverPaused && !finished && reachable()) {
|
|
658
|
+
if (!columns && !driverPaused && !finished && !cancelSent() && reachable()) {
|
|
654
659
|
driverPaused = true
|
|
655
660
|
req.pauseQuery()
|
|
656
661
|
}
|