mssql 8.1.3 → 8.1.4
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 +4 -0
- package/LICENSE.md +22 -22
- package/bin/mssql +0 -0
- package/lib/isolationlevel.js +9 -9
- package/lib/msnodesqlv8/connection-pool.js +10 -2
- package/lib/tedious/connection-pool.js +10 -2
- package/package.json +1 -1
package/CHANGELOG.txt
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
v8.1.4 (2022-08-18)
|
|
2
|
+
-------------------
|
|
3
|
+
[fix] fix regression in requestTimout option not accepting `0` as a value ([#1421](https://github.com/tediousjs/node-mssql/pull/1421))
|
|
4
|
+
|
|
1
5
|
v8.1.3 (2022-08-08)
|
|
2
6
|
-------------------
|
|
3
7
|
[fix] requestTimeout correctly resolved ([#1398](https://github.com/tediousjs/node-mssql/pull/1398))
|
package/LICENSE.md
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2013-2018 Patrik Simek and contributors
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
22
|
-
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2013-2018 Patrik Simek and contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
package/bin/mssql
CHANGED
|
File without changes
|
package/lib/isolationlevel.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
READ_UNCOMMITTED: 0x01,
|
|
5
|
-
READ_COMMITTED: 0x02,
|
|
6
|
-
REPEATABLE_READ: 0x03,
|
|
7
|
-
SERIALIZABLE: 0x04,
|
|
8
|
-
SNAPSHOT: 0x05
|
|
9
|
-
}
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
READ_UNCOMMITTED: 0x01,
|
|
5
|
+
READ_COMMITTED: 0x02,
|
|
6
|
+
REPEATABLE_READ: 0x03,
|
|
7
|
+
SERIALIZABLE: 0x04,
|
|
8
|
+
SNAPSHOT: 0x05
|
|
9
|
+
}
|
|
@@ -12,6 +12,14 @@ const CONNECTION_DRIVER = ['darwin', 'linux'].includes(platform()) ? 'ODBC Drive
|
|
|
12
12
|
const CONNECTION_STRING_PORT = `Driver=${CONNECTION_DRIVER};Server=#{server},#{port};Database=#{database};Uid=#{user};Pwd=#{password};Trusted_Connection=#{trusted};Encrypt=#{encrypt};`
|
|
13
13
|
const CONNECTION_STRING_NAMED_INSTANCE = `Driver=${CONNECTION_DRIVER};Server=#{server}\\#{instance};Database=#{database};Uid=#{user};Pwd=#{password};Trusted_Connection=#{trusted};Encrypt=#{encrypt};`
|
|
14
14
|
|
|
15
|
+
function firstDefined () {
|
|
16
|
+
for (let i = 0; i < arguments.length; i++) {
|
|
17
|
+
if (typeof arguments[i] !== 'undefined') {
|
|
18
|
+
return arguments[i]
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
15
23
|
class ConnectionPool extends BaseConnectionPool {
|
|
16
24
|
_poolCreate () {
|
|
17
25
|
return new shared.Promise((resolve, reject) => {
|
|
@@ -21,11 +29,11 @@ class ConnectionPool extends BaseConnectionPool {
|
|
|
21
29
|
defaultConnectionString = CONNECTION_STRING_NAMED_INSTANCE
|
|
22
30
|
}
|
|
23
31
|
|
|
24
|
-
this.config.requestTimeout = this.config.requestTimeout
|
|
32
|
+
this.config.requestTimeout = firstDefined(this.config.requestTimeout, this.config.timeout, 15000)
|
|
25
33
|
|
|
26
34
|
const cfg = {
|
|
27
35
|
conn_str: this.config.connectionString || defaultConnectionString,
|
|
28
|
-
conn_timeout: (this.config.connectionTimeout
|
|
36
|
+
conn_timeout: firstDefined(this.config.connectionTimeout, this.config.timeout, 15000) / 1000
|
|
29
37
|
}
|
|
30
38
|
|
|
31
39
|
cfg.conn_str = cfg.conn_str.replace(/#{([^}]*)}/g, (p) => {
|
|
@@ -7,6 +7,14 @@ const { IDS } = require('../utils')
|
|
|
7
7
|
const shared = require('../shared')
|
|
8
8
|
const ConnectionError = require('../error/connection-error')
|
|
9
9
|
|
|
10
|
+
function firstDefined () {
|
|
11
|
+
for (let i = 0; i < arguments.length; i++) {
|
|
12
|
+
if (typeof arguments[i] !== 'undefined') {
|
|
13
|
+
return arguments[i]
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
10
18
|
class ConnectionPool extends BaseConnectionPool {
|
|
11
19
|
_poolCreate () {
|
|
12
20
|
return new shared.Promise((resolve, reject) => {
|
|
@@ -36,8 +44,8 @@ class ConnectionPool extends BaseConnectionPool {
|
|
|
36
44
|
|
|
37
45
|
cfg.options.database = cfg.options.database || this.config.database
|
|
38
46
|
cfg.options.port = cfg.options.port || this.config.port
|
|
39
|
-
cfg.options.connectTimeout = cfg.options.connectTimeout
|
|
40
|
-
cfg.options.requestTimeout = cfg.options.requestTimeout
|
|
47
|
+
cfg.options.connectTimeout = firstDefined(cfg.options.connectTimeout, this.config.connectionTimeout, this.config.timeout, 15000)
|
|
48
|
+
cfg.options.requestTimeout = firstDefined(cfg.options.requestTimeout, this.config.requestTimeout, this.config.timeout, 15000)
|
|
41
49
|
cfg.options.tdsVersion = cfg.options.tdsVersion || '7_4'
|
|
42
50
|
cfg.options.rowCollectionOnDone = cfg.options.rowCollectionOnDone || false
|
|
43
51
|
cfg.options.rowCollectionOnRequestCompletion = cfg.options.rowCollectionOnRequestCompletion || false
|