mssql 6.3.1 → 6.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/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
@@ -35,6 +35,10 @@ class PreparedStatement extends EventEmitter {
35
35
  this.parameters = {}
36
36
  }
37
37
 
38
+ get config () {
39
+ return this.parent.config
40
+ }
41
+
38
42
  get connected () {
39
43
  return this.parent.connected
40
44
  }
@@ -25,7 +25,7 @@ class Request extends EventEmitter {
25
25
  /**
26
26
  * Create new Request.
27
27
  *
28
- * @param {Connection|ConnectionPool|Transaction|PreparedStatement} parent If ommited, global connection is used instead.
28
+ * @param {Connection|ConnectionPool|Transaction|PreparedStatement} parent If omitted, global connection is used instead.
29
29
  */
30
30
 
31
31
  constructor (parent) {
@@ -38,6 +38,8 @@ class Request extends EventEmitter {
38
38
  this._paused = false
39
39
  this.parent = parent || globalConnection.pool
40
40
  this.parameters = {}
41
+ this.stream = null
42
+ this.arrayRowMode = null
41
43
  }
42
44
 
43
45
  get paused () {
@@ -223,8 +225,8 @@ class Request extends EventEmitter {
223
225
  */
224
226
 
225
227
  batch (batch, callback) {
226
- if (this.stream == null && this.connection) this.stream = this.connection.config.stream
227
- if (this.arrayRowMode == null && this.connection) this.arrayRowMode = this.connection.config.arrayRowMode
228
+ if (this.stream === null && this.parent) this.stream = this.parent.config.stream
229
+ if (this.arrayRowMode === null && this.parent) this.arrayRowMode = this.parent.config.arrayRowMode
228
230
  this.rowsAffected = 0
229
231
 
230
232
  if (typeof callback === 'function') {
@@ -287,11 +289,11 @@ class Request extends EventEmitter {
287
289
  */
288
290
 
289
291
  _batch (batch, callback) {
290
- if (!this.connection) {
292
+ if (!this.parent) {
291
293
  return setImmediate(callback, new RequestError('No connection is specified for that request.', 'ENOCONN'))
292
294
  }
293
295
 
294
- if (!this.connection.connected) {
296
+ if (!this.parent.connected) {
295
297
  return setImmediate(callback, new ConnectionError('Connection is closed.', 'ECONNCLOSED'))
296
298
  }
297
299
 
@@ -316,8 +318,8 @@ class Request extends EventEmitter {
316
318
  options = {}
317
319
  }
318
320
 
319
- if (this.stream == null && this.connection) this.stream = this.connection.config.stream
320
- if (this.arrayRowMode == null && this.connection) this.arrayRowMode = this.connection.config.arrayRowMode
321
+ if (this.stream === null && this.parent) this.stream = this.parent.config.stream
322
+ if (this.arrayRowMode === null && this.parent) this.arrayRowMode = this.parent.config.arrayRowMode
321
323
 
322
324
  if (this.stream || typeof callback === 'function') {
323
325
  this._bulk(table, options, (err, rowsAffected) => {
@@ -393,8 +395,8 @@ class Request extends EventEmitter {
393
395
  */
394
396
 
395
397
  query (command, callback) {
396
- if (this.stream == null && this.connection) this.stream = this.connection.config.stream
397
- if (this.arrayRowMode == null && this.connection) this.arrayRowMode = this.connection.config.arrayRowMode
398
+ if (this.stream === null && this.parent) this.stream = this.parent.config.stream
399
+ if (this.arrayRowMode === null && this.parent) this.arrayRowMode = this.parent.config.arrayRowMode
398
400
  this.rowsAffected = 0
399
401
 
400
402
  if (typeof callback === 'function') {
@@ -482,8 +484,8 @@ class Request extends EventEmitter {
482
484
  */
483
485
 
484
486
  execute (command, callback) {
485
- if (this.stream == null && this.connection) this.stream = this.connection.config.stream
486
- if (this.arrayRowMode == null && this.connection) this.arrayRowMode = this.connection.config.arrayRowMode
487
+ if (this.stream === null && this.parent) this.stream = this.parent.config.stream
488
+ if (this.arrayRowMode === null && this.parent) this.arrayRowMode = this.parent.config.arrayRowMode
487
489
  this.rowsAffected = 0
488
490
 
489
491
  if (typeof callback === 'function') {
@@ -37,6 +37,10 @@ class Transaction extends EventEmitter {
37
37
  this.name = ''
38
38
  }
39
39
 
40
+ get config () {
41
+ return this.parent.config
42
+ }
43
+
40
44
  get connected () {
41
45
  return this.parent.connected
42
46
  }
package/lib/cli.js CHANGED
@@ -1,113 +1,113 @@
1
- 'use strict'
2
-
3
- const fs = require('fs')
4
- const path = require('path')
5
- const sql = require('./tedious')
6
-
7
- const exit = process.exit
8
- const write = text => process.stdout.write(text)
9
- Buffer.prototype.toJSON = () => {
10
- return `0x${this.toString('hex')}`
11
- }
12
-
13
- // Resolve config path
14
-
15
- let cfgPath = path.resolve(process.argv[2] || process.cwd())
16
- if (fs.lstatSync(cfgPath).isDirectory()) {
17
- cfgPath = path.resolve(cfgPath, './.mssql.json')
18
- }
19
- if (!fs.existsSync(cfgPath)) {
20
- console.error('Config file not found.')
21
- exit(1)
22
- }
23
-
24
- // Config checks & parse
25
-
26
- let config
27
- try {
28
- config = fs.readFileSync(cfgPath)
29
- } catch (err) {
30
- console.error(`Failed to load config file. ${err.message}`)
31
- exit(1)
32
- }
33
-
34
- try {
35
- config = JSON.parse(config)
36
- } catch (err) {
37
- console.error(`Failed to parse config file. ${err.message}`)
38
- exit(1)
39
- }
40
-
41
- // Read stdin
42
-
43
- const buffer = []
44
-
45
- process.stdin.setEncoding('utf8')
46
- process.stdin.on('readable', () => buffer.push(process.stdin.read()))
47
-
48
- process.stdin.on('end', () => {
49
- const statement = buffer.join('')
50
- let rst = 0
51
- let index = 0
52
-
53
- if (!statement.length) {
54
- console.error('Statement is empty.')
55
- exit(1)
56
- }
57
-
58
- sql.connect(config, err => {
59
- if (err) {
60
- console.error(err.message)
61
- exit(1)
62
- }
63
-
64
- write('[')
65
-
66
- const request = new sql.Request()
67
- request.stream = true
68
- request.on('recordset', () => {
69
- index = 0
70
- if (rst++ > 0) {
71
- write('],')
72
- }
73
-
74
- return write('[')
75
- })
76
-
77
- request.on('error', err => {
78
- console.error(err.message)
79
- sql.close()
80
- return exit(1)
81
- })
82
-
83
- request.on('row', row => {
84
- if (index++ > 0) {
85
- write(',')
86
- }
87
-
88
- return write(JSON.stringify(row))
89
- })
90
-
91
- request.on('done', () => {
92
- if (rst > 0) {
93
- write(']')
94
- }
95
-
96
- write(']\n')
97
- sql.close()
98
- return exit(0)
99
- })
100
-
101
- request.query(statement)
102
- })
103
- })
104
-
105
- process.on('uncaughtException', err => {
106
- if (err.code === 'EPIPE') {
107
- console.error('Failed to pipe output stream.')
108
- } else {
109
- console.error(err.message)
110
- }
111
-
112
- exit(1)
113
- })
1
+ 'use strict'
2
+
3
+ const fs = require('fs')
4
+ const path = require('path')
5
+ const sql = require('./tedious')
6
+
7
+ const exit = process.exit
8
+ const write = text => process.stdout.write(text)
9
+ Buffer.prototype.toJSON = () => {
10
+ return `0x${this.toString('hex')}`
11
+ }
12
+
13
+ // Resolve config path
14
+
15
+ let cfgPath = path.resolve(process.argv[2] || process.cwd())
16
+ if (fs.lstatSync(cfgPath).isDirectory()) {
17
+ cfgPath = path.resolve(cfgPath, './.mssql.json')
18
+ }
19
+ if (!fs.existsSync(cfgPath)) {
20
+ console.error('Config file not found.')
21
+ exit(1)
22
+ }
23
+
24
+ // Config checks & parse
25
+
26
+ let config
27
+ try {
28
+ config = fs.readFileSync(cfgPath)
29
+ } catch (err) {
30
+ console.error(`Failed to load config file. ${err.message}`)
31
+ exit(1)
32
+ }
33
+
34
+ try {
35
+ config = JSON.parse(config)
36
+ } catch (err) {
37
+ console.error(`Failed to parse config file. ${err.message}`)
38
+ exit(1)
39
+ }
40
+
41
+ // Read stdin
42
+
43
+ const buffer = []
44
+
45
+ process.stdin.setEncoding('utf8')
46
+ process.stdin.on('readable', () => buffer.push(process.stdin.read()))
47
+
48
+ process.stdin.on('end', () => {
49
+ const statement = buffer.join('')
50
+ let rst = 0
51
+ let index = 0
52
+
53
+ if (!statement.length) {
54
+ console.error('Statement is empty.')
55
+ exit(1)
56
+ }
57
+
58
+ sql.connect(config, err => {
59
+ if (err) {
60
+ console.error(err.message)
61
+ exit(1)
62
+ }
63
+
64
+ write('[')
65
+
66
+ const request = new sql.Request()
67
+ request.stream = true
68
+ request.on('recordset', () => {
69
+ index = 0
70
+ if (rst++ > 0) {
71
+ write('],')
72
+ }
73
+
74
+ return write('[')
75
+ })
76
+
77
+ request.on('error', err => {
78
+ console.error(err.message)
79
+ sql.close()
80
+ return exit(1)
81
+ })
82
+
83
+ request.on('row', row => {
84
+ if (index++ > 0) {
85
+ write(',')
86
+ }
87
+
88
+ return write(JSON.stringify(row))
89
+ })
90
+
91
+ request.on('done', () => {
92
+ if (rst > 0) {
93
+ write(']')
94
+ }
95
+
96
+ write(']\n')
97
+ sql.close()
98
+ return exit(0)
99
+ })
100
+
101
+ request.query(statement)
102
+ })
103
+ })
104
+
105
+ process.on('uncaughtException', err => {
106
+ if (err.code === 'EPIPE') {
107
+ console.error('Failed to pipe output stream.')
108
+ } else {
109
+ console.error(err.message)
110
+ }
111
+
112
+ exit(1)
113
+ })
@@ -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
+ }
package/package.json CHANGED
@@ -21,14 +21,14 @@
21
21
  "azure",
22
22
  "node-mssql"
23
23
  ],
24
- "version": "6.3.1",
24
+ "version": "6.4.1",
25
25
  "main": "index.js",
26
26
  "repository": "github:tediousjs/node-mssql",
27
27
  "license": "MIT",
28
28
  "dependencies": {
29
- "debug": "^4.3.1",
29
+ "debug": "^4.3.3",
30
30
  "tarn": "^1.1.5",
31
- "tedious": "^6.7.0"
31
+ "tedious": "^6.7.1"
32
32
  },
33
33
  "devDependencies": {
34
34
  "mocha": "^6.2.3",
package/CHANGELOG.txt DELETED
@@ -1,532 +0,0 @@
1
- v6.3.1 (2021-01-01)
2
- -------------------
3
- [fix] Ensure line endings are unix style (LF)
4
-
5
- v6.3.0 (2020-12-14)
6
- -------------------
7
- [new] Result sets with duplicate keys can now be handled using `request.arrayRowMode` ([#1130](https://github.com/tediousjs/node-mssql/pull/1130))
8
- [fix] Issue with geography v2 parsing resolve ([#1138](https://github.com/tediousjs/node-mssql/pull/1138))
9
- [fix] Fixed issue where msnodesqlv8 could sometimes terminate queries before all errors has been emitted causing queries to hang ([#1145](https://github.com/tediousjs/node-mssql/pull/1145))
10
-
11
- v6.2.3 (2020-09-25)
12
- -------------------
13
- [fix] Remove reference to global pool on connection error ([#1107](https://github.com/tediousjs/node-mssql/pull/1107))
14
- [fix] Trailing rows from request streams using msnodesqlv8 driver fail to be emitted ([#1109](https://github.com/tediousjs/node-mssql/pull/1109))
15
-
16
- v6.2.2 (2020-09-18)
17
- -------------------
18
- [fix] Avoid using deprecated `.inspect` on Objects ([#1071](https://github.com/tediousjs/node-mssql/pull/1071))
19
- [fix] Bump various dependencies for security fixes ([#1102](https://github.com/tediousjs/node-mssql/pull/1102))
20
-
21
- v6.2.1 (2020-07-22)
22
- -------------------
23
- [fix] Bump various dependencies for security fixes
24
-
25
- v6.2.0 (2020-03-13)
26
- -------------------
27
- [new] Set default isolationLevel for all transactions ([#1005](https://github.com/tediousjs/node-mssql/pull/1005))
28
- [new] sql.Date now is coerced into a date object ([#1007](https://github.com/tediousjs/node-mssql/pull/1007))
29
- [fix] Bump acorn dependency for security fix
30
-
31
- v6.1.0 (2020-02-17)
32
- -------------------
33
- [new] Add `Request.template` helper for providing templated strings to queries ([#960](https://github.com/tediousjs/node-mssql/pull/960))
34
- [new] Repeat calls to `ConnectionPool.connect()` resolve ([#941](https://github.com/tediousjs/node-mssql/pull/941))
35
- [new] Stored procedure params are now logged to debug log ([#979](https://github.com/tediousjs/node-mssql/pull/979))
36
- [fix] Repeat calls to `mssql.connect()` will now resolve correctly ([#986](https://github.com/tediousjs/node-mssql/pull/986))
37
- [fix] Connections are encrypted by default as documented ([#977](https://github.com/tediousjs/node-mssql/pull/977))
38
- [fix] Tagged template literal queries with empty array values now work ([#990](https://github.com/tediousjs/node-mssql/pull/990))
39
-
40
- v6.0.1 (2019-11-15)
41
- -------------------
42
- [fix] Fix an issue with connection strings where usernames have url encoded values ([#945](https://github.com/tediousjs/node-mssql/pull/945)
43
-
44
- v6.0.0 (2019-11-05)
45
- -------------------
46
- [fix] Fixed bug when trying to bulk insert columns that were `NVarChar(MAX)` ([#901](https://github.com/tediousjs/node-mssql/pull/901))
47
- [fix] Fixed an issue where Object prototype pollution could cause errors ([#879](https://github.com/tediousjs/node-mssql/pull/879))
48
- [fix] Fixed an issue where Request.input didn't validate against 0 parameters being passed ([#885](https://github.com/tediousjs/node-mssql/pull/885))
49
- [new] Implement pause/resume for msnodesqlv8 driver ([#877](https://github.com/tediousjs/node-mssql/pull/877))
50
- [new] Added `healthy` flag to the pool to help determine if the pool is safe to use or not ([#816](https://github.com/tediousjs/node-mssql/pull/816))
51
- [new] Invalid isolation levels passed to transactions will now throw an error
52
- [new] Duplicate parameter names in queries/stored procedures will now throw an error
53
- [new] `replaceInput` and `replaceOutput` functions added to `Request` and `PreparedStatement` to facilitate replacing existing parameters
54
- [new] Calls to the global `connect` function will return the global connection if it exists
55
- [new] Bulk table inserts now attempt to coerce Date objects out of non Date values
56
- [change] Closing the global connection by reference will now cleanup the internally managed globalConnection
57
- [change] Upgraded tedious to v6 ([#818](https://github.com/tediousjs/node-mssql/pull/818) and [#933](https://github.com/tediousjs/node-mssql/pull/933))
58
- [change] Upgraded msnodesqlv8 support to v0.7 ([#877](https://github.com/tediousjs/node-mssql/pull/877))
59
- [change] Remove references to deprecated `TYPES.Null` from tedious
60
- [change] `options.encrypt` is now set to true by default
61
- [change] Upgraded `debug` dependency to v4
62
- [change] Config objects are cloned so that the original object is not modified
63
- [change] Replaced pool library (`generic-pool`) with `tarn.js` ([#808](https://github.com/tediousjs/node-mssql/pull/808))
64
- [removed] Backoff try strategy for creating connections removed, `tarn.js` built-in retry strategy used instead
65
-
66
- v5.1.4 (2021-01-01)
67
- -------------------
68
- [fix] Ensure line endings are unix style (LF)
69
-
70
- v5.1.3 (2020-09-18)
71
- -------------------
72
- [fix] Avoid using deprecated `.inspect` on Objects ([#1071](https://github.com/tediousjs/node-mssql/pull/1071))
73
- [fix] Bump various dependencies for security fixes ([#1102](https://github.com/tediousjs/node-mssql/pull/1102))
74
-
75
- v5.1.2 (2020-07-22)
76
- -------------------
77
- [fix] Bump various dependencies for security fixes
78
-
79
- v5.1.1 (2020-03-13)
80
- -------------------
81
- [fix] Bump acorn dependency for security fix
82
-
83
- v5.1.0 (2019-04-17)
84
- -------------------
85
- [new] Add readOnlyIntent to connection string parser ([#853](https://github.com/tediousjs/node-mssql/pull/853))
86
-
87
- v5.0.6 (2019-04-17)
88
- -------------------
89
- [fix] Ensure callbacks don't block the event loop by executing them with `setImmediate` ([#855](https://github.com/tediousjs/node-mssql/pull/855))
90
-
91
- v5.0.5 (2019-03-28)
92
- -------------------
93
- [fix] Fix an issue where connections that error can deplete the pool ([#842](https://github.com/tediousjs/node-mssql/pull/842))
94
-
95
- v5.0.4 (2019-03-27)
96
- -------------------
97
- [fix] Fix a bug where msnodesqlv8 driver could execute callbacks twice ([#834](https://github.com/tediousjs/node-mssql/pull/834))
98
- [fix] npm audit fix on vulnerable dependencies
99
-
100
- v5.0.3 (2019-03-13)
101
- -------------------
102
- [fix] Fix a bug with streamed requests that start paused ([#833](https://github.com/tediousjs/node-mssql/pull/833))
103
-
104
- v5.0.2 (2019-03-09)
105
- -------------------
106
- [change] Remove references to deprecated `TYPES.Null` from tedious
107
-
108
- v5.0.1 (2019-03-09)
109
- -------------------
110
- [change] Config objects are cloned so that the original object is not modified
111
-
112
- v5.0.0 (2019-03-07)
113
- -------------------
114
- [new] Added pause / resume feature to streamed requests ([#775](https://github.com/tediousjs/node-mssql/pull/775))
115
- [new] Added options argument to bulk requests for compatibility with tedious driver
116
- [new] Added a backoff retry strategy for failed connection creation to mitigate issue with `generic-pool` connection creation logic ([#806](https://github.com/tediousjs/node-mssql/pull/806)
117
- [change] Updated to latest Tedious 4.1.1
118
- [removed] Node.js < 6 is no longer supported
119
- [removed] Support dropped for deprecated tedious configuration values and types
120
-
121
- v4.3.9 (2020-07-22)
122
- -------------------
123
- [fix] Bump various dependencies for security fixes
124
-
125
- v4.3.8 (2020-03-13)
126
- -------------------
127
- [fix] Bump acorn dependency for security fix
128
-
129
- v4.3.7 (2019-03-29)
130
- -------------------
131
- [fix] Fix an issue where connections that error can deplete the pool ([#842](https://github.com/tediousjs/node-mssql/pull/842))
132
-
133
- v4.3.6 (2019-03-27)
134
- -------------------
135
- [fix] Fix a bug where msnodesqlv8 driver could execute callbacks twice ([#834](https://github.com/tediousjs/node-mssql/pull/834))
136
- [fix] Bump js-yaml dependency for security fix
137
-
138
- v4.3.5 (2019-03-09)
139
- -------------------
140
- [change] Remove references to deprecated `TYPES.Null` from tedious
141
-
142
- v4.3.4 (2019-03-09)
143
- -------------------
144
- [change] Config objects are cloned so that the original object is not modified
145
-
146
- v4.3.3 (2019-03-07)
147
- -------------------
148
- [change] Updated to latest generic-pool 3.6.1
149
-
150
- v4.3.0 (2018-11-20)
151
- -------------------
152
- [new] Add beforeConnect handler
153
- [change] Interpret connection timeout in seconds (not milliseconds)
154
-
155
- v4.2.3 (2018-11-03)
156
- -------------------
157
- [new] Add info event for execute function
158
- [fix] Fix JSON parsing with empty recordsets
159
- [new] Array / string literal template query preparation fixes
160
- [new] Passing encrypt option from mssql connection options to tedious options
161
- [change] Return the _poolDestroy promise before connecting again
162
-
163
- v4.2.2 (2018-10-17)
164
- -------------------
165
- [change] Updated to latest Tedious 2.7.1
166
-
167
- v4.2.1 (2018-08-05)
168
- -------------------
169
- [fix] Fix connections in the pool depleting due to unfulfilled Promises and timeouts
170
- [change] Updated to latest Tedious 2.6.4
171
-
172
- v4.2.0 (2018-07-05)
173
- -------------------
174
- [new] Added TVP support for msnodesqlv8 driver
175
- [new] Added support for information messages in msnodesqlv8 driver
176
- [new] Added support for request cancellation in msnodesqlv8 driver
177
- [fix] Fixed Tedious deprecation warnings
178
- [fix] Fixed ResourceRequest timed out error
179
- [fix] All query and batch methods now have the same interface
180
- [fix] Fixed msnodesqlv8 issue where the encrypt option was getting ignored
181
- [change] Updated to latest Tedious 2.3.1
182
-
183
- v4.1.0 (2017-09-29)
184
- -------------------
185
- [new] Adding support for the MultiSubnetFailover option in connection strings (Paul Kehrer)
186
- [new] Add request timeout support for msnodesqlv8 queries (Michael Parque)
187
- [fix] Fix type inference of non-integer numbers (Andrew Crites)
188
- [fix] Set acquireTimeout on generic pool (Karl Wiggisser)
189
-
190
- v4.0.4 (2017-04-25)
191
- -------------------
192
- [fix] Fix auto-closing of idle connections
193
-
194
- v4.0.3 (2017-04-25)
195
- -------------------
196
- [fix] Fixed broken CLI & debugging
197
-
198
- v4.0.2 (2017-04-19)
199
- -------------------
200
- [fix] Fixed broken JSON parser
201
-
202
- v4.0.1 (2017-04-02)
203
- -------------------
204
- [fix] Fixed stream in pipe mode
205
-
206
- v4.0.0 (2017-04-01)
207
- -------------------
208
- [new] Completly rewritten to ES6
209
- [new] Library is now compatible with Webpack
210
- [new] Library is ready for async/await
211
- [change] Removed support for < Node.js 4
212
- [change] Removed support for outdated node-tds and msnodesql drivers
213
- [change] Removed require('mssql/nofix') syntax
214
- [change] Removed verbose and debug mode
215
- [change] Removed 'driver' from options
216
- [change] Removed Transaction and Prepared Statement queues
217
- [change] Removed 'multiple' directive
218
- [change] Connection renamed to ConnectionPool
219
- [change] Updated to latest Tedious 2.0.0
220
-
221
- v3.3.0 (2016-05-06)
222
- -------------------
223
- [new] Added support for receiving informational messages
224
- [new] Added JSON support for msnodesql and msnodesqlv8 drivers
225
- [fix] Minor fixes in connection string parsing
226
-
227
- v3.2.1 (2016-04-16)
228
- -------------------
229
- [fix] Added PreparedStatement.lastRequest to access internal Request when using Promises
230
-
231
- v3.2.0 (2016-04-11)
232
- -------------------
233
- [new] Added experimental support for ES6 tagged template literals
234
- [new] Added support for Variant data type
235
- [change] Updated to latest Tedious 1.14.0
236
-
237
- v3.1.2 (2016-03-08)
238
- -------------------
239
- [fix] Correctly release connection after transaction error
240
-
241
- v3.1.1 (2016-02-21)
242
- -------------------
243
- [change] Minor internal changes because of connect-mssql module
244
-
245
- v3.1.0 (2016-02-13)
246
- -------------------
247
- [new] Added support for creating columns with primary keys in TVP Tables
248
-
249
- v3.0.1 (2016-02-04)
250
- -------------------
251
- [fix] Fix error causing app to crash when parsing json/xml from stored procedure
252
- [fix] Correctly check connection health after socket error
253
-
254
- v3.0.0 (2016-01-08)
255
- -------------------
256
- [new] Version bump because of breakinch change introduced in release 2.6
257
-
258
- v2.6.2 (2015-12-25) - unpublished from npm
259
- -------------------
260
- [new] Added support for receiving number of affected rows
261
- [new] Automatically concat chunks of FOR XML / FOR JSON recordset
262
- [fix] Correctly preserve domains
263
-
264
- v2.5.0 (2015-12-17)
265
- -------------------
266
- [new] Added support for new TDS driver msnodesqlv8
267
- [new] Support for configs formated as Connection String, Connection String URI
268
-
269
- v2.4.0 (2015-12-11)
270
- -------------------
271
- [new] Connection.connect, PreparedStatement.prepare and Transaction.begin now returns instance of itself as a first argument to Promise resolver.
272
- [fix] Correctly handle Socket Errors inside Requests (Jørgen Elgaard Larsen)
273
-
274
- v2.3.2 (2015-11-11)
275
- -------------------
276
- [change] Updated to latest Tedious 1.13.1
277
-
278
- v2.3.1 (2015-09-21)
279
- -------------------
280
- [fix] JSON fixes
281
-
282
- v2.3.0 (2015-09-20)
283
- -------------------
284
- [new] Experimental JSON support
285
-
286
- v2.2.1 (2015-09-19)
287
- -------------------
288
- [change] Updated to latest Tedious 1.12.3
289
- [fix] Promise not returns rowCount in bulk load (Ben Farr)
290
-
291
- v2.2.0 (2015-08-17)
292
- -------------------
293
- [new] Added column metadata identity, caseSensitive and readOnly (nino-porcino)
294
-
295
- v2.1.8 (2015-08-11)
296
- -------------------
297
- [change] Updated to latest Tedious 1.12.2
298
-
299
- v2.1.7 (2015-08-09)
300
- -------------------
301
- [change] Updated to latest Tedious 1.11.4
302
-
303
- v2.1.6 (2015-06-17)
304
- -------------------
305
- [change] Updated to latest Tedious 1.11.2
306
-
307
- v2.1.5 (2015-06-05)
308
- -------------------
309
- [fix] Correctly resolve database and schema name from table path.
310
-
311
- v2.1.4 (2015-06-05)
312
- -------------------
313
- [new] Better test coverage, automated integration tests.
314
- [fix] msnodesql: Manual transaction aborting.
315
- [fix] msnodesql: Tests.
316
-
317
- v2.1.3 (2015-05-03)
318
- -------------------
319
- [fix] msnodesql: Release connection to pool on query error (Farhan Khan)
320
-
321
- v2.1.2 (2015-03-28)
322
- -------------------
323
- [fix] Fix name parsing in Table constructor (David Mercer)
324
-
325
- v2.1.1 (2015-02-25)
326
- -------------------
327
- [fix] Fix Promise in Prepared Statement
328
-
329
- v2.1.0 (2015-02-20)
330
- -------------------
331
- [new] Detailed SQL errors
332
- [fix] Precise detection of column data types
333
-
334
- v2.0.0 (2015-02-17)
335
- -------------------
336
- [change] Updated to latest Tedious 1.10.0
337
- [new] Promises
338
- [new] Pipe request to object stream
339
- [new] Integrated type checks
340
- [new] CLI
341
- [fix] Transaction Abort Handling
342
- [fix] Allow rollback on transaction with queued requests
343
- [fix] Connection pool fixes
344
- [fix] Minor fixes
345
-
346
- v1.3.0 (2014-10-27)
347
- -------------------
348
- [change] Updated to latest Tedious 1.7.0
349
- [new] Tedious: Char and NChar types are now available as input parameters
350
-
351
- v1.2.1 (2014-10-07)
352
- -------------------
353
- [change] Updated to latest Tedious 1.5.3
354
-
355
- v1.2.0 (2014-08-26)
356
- -------------------
357
- [change] Updated to latest Tedious 1.4.0
358
- [new] Added support for bulk insert.
359
-
360
- v1.1.1 (2014-08-07)
361
- -------------------
362
- [new] Added column index to recordset metadata.
363
- [fix] Minor fixes in Tedious driver
364
-
365
- v1.1.0 (2014-07-13)
366
- -------------------
367
- [change] Updated to latest Tedious 1.1.0
368
- [new] Added support for domain logins (NTLM)
369
-
370
- v1.0.2 (2014-07-04)
371
- -------------------
372
- [new] Added support for input and output parameters in batch method.
373
- [new] Added checks for SQL injection in parameter names
374
-
375
- v1.0.1 (2014-07-04)
376
- -------------------
377
- [new] Added support for Streaming in Prepared Statements
378
-
379
- v1.0.0 (2014-07-04)
380
- -------------------
381
- [new] Start of semantic versioning, and commitment to stable API until 2.0.0
382
-
383
- v0.6.2 (2014-07-04)
384
- -------------------
385
- [new] Added batch() method to execute sql commands like "create procedure"
386
- [new] Cancel request in node-tds driver
387
- [fix] Fixed VarChar/NVarChar/VarBinary MAX in prepared statements
388
-
389
- v0.6.1 (2014-07-04)
390
- -------------------
391
- [change] TDS debugging simplified
392
-
393
- v0.6.0 (2014-07-03)
394
- -------------------
395
- [change] Updated to latest Tedious 1.0.0
396
- [new] Added support for Streaming
397
- [new] Added option to set request timeout (config.requestTimeout = 15000)
398
- [new] Errors documented
399
- [change] Connection timeout renamed from config.timeout to config.connectionTimeout
400
- [fix] Minor bug fixes
401
-
402
- v0.5.5 (2014-06-24)
403
- -------------------
404
- [fix] Failed login left open connection pool
405
-
406
- v0.5.4 (2014-06-15)
407
- -------------------
408
- [new] Multiple errors handling
409
-
410
- v0.5.3 (2014-04-04)
411
- -------------------
412
- [fix] Multiple recordsets in Prepared Statements
413
-
414
- v0.5.2 (2014-04-04)
415
- -------------------
416
- [new] Support for Prepared Statements
417
- [fix] Fixed order of output parameters
418
- [fix] Minor fixes in node-tds driver
419
-
420
- v0.5.1 (2014-04-01)
421
- -------------------
422
- [change] Updated to new Tedious 0.2.1
423
- [new] You can now easily setup type's length/scale (sql.VarChar(50))
424
- [new] Serialization of Geography and Geometry CLR types
425
- [new] Support for creating Table-Value Parameters (var tvp = new sql.Table())
426
- [new] Output parameters are now Input-Output and can handle initial value
427
- [new] Option to choose whether to pass/receive times in UTC or local time
428
- [new] Connecting to named instances simplified
429
- [change] Default SQL data type for JS String type is now NVarChar (was VarChar)
430
-
431
- v0.5.0 (2014-01-25)
432
- -------------------
433
- [new] You can now attach event listeners to Connection (connect, close), Transaction (begin, commit, rollback) and Request (row, recordset, done)
434
- [new] You can now set length of Char, NChar and Binary output parameters
435
- [new] You can now change default transaction isolation level
436
- [change] Errors are now splitted to three categories for better error handling - ConnectionError, TransactionError, ReqestError
437
- [new] Tedious: Binary and VarBinary types are now available as input and output parameters
438
- [new] Tedious: Image type is now available as input parameter
439
- [change] Tedious: Binary, VarBinary and Image types are now returned as buffer (was byte array)
440
- [change] Tedious: Transaction isolationLevel default is now READ_COMMITED (was READ_UNCOMMITED)
441
- [fix] Tedious: Fixed issue when zero value was casted as null when using BigInt as input parameter
442
- [fix] Tedious: Fixed issue when dates before 1900/01/01 in input parameters resulted in "Out of bounds" error
443
- [new] node-tds: UniqueIdentifier type in now available as input and output parameter
444
- [fix] node-tds: UniqueIdentifier type is now parsed correctly as string value (was buffer)
445
- [fix] node-tds: Text, NText, Char, NChar, VarChar and NVarChar input parameters has correct lengths
446
- [fix] node-tds: Fixed Error messages
447
- [fix] Msnodesql: Char, NChar, Xml, Text, NText and VarBinary types are now correctly functional as output parameters
448
-
449
- v0.4.5 (2014-01-23)
450
- -------------------
451
- [new] Added support for "co" flow controller via co-mssql module
452
-
453
- v0.4.4 (2014-01-22)
454
- -------------------
455
- [change] returnValue also accessible as property of recordsets
456
-
457
- v0.4.3 (2014-01-14)
458
- -------------------
459
- [fix] Even better network error handling in tedious
460
- [new] Module is compatible with Node.js 0.11
461
-
462
- v0.4.2 (2014-01-06)
463
- -------------------
464
- [new] Added connection timeout for node-tds
465
- [fix] Module now handle tedious network errors correctly
466
- [fix] Connection pool now destroy failed connections correctly
467
- [fix] Connection to instance name via tedious now works correctly
468
- [change] Option 'timeout' is now common option for all drivers (see documentation)
469
-
470
- v0.4.1 (2013-12-13)
471
- -------------------
472
- [fix] Filter empty recordsets when NOCOUNT is OFF
473
-
474
- v0.4.0 (2013-12-12)
475
- -------------------
476
- [new] Added support for transactions.
477
- [new] node-tds is now available as an optional TDS driver.
478
- [new] Documentation updated to CSDoc spec.
479
- [change] Tedious driver no longer use tedious-connection-pool for connection pooling
480
- [change] Msnodesql is now pooled
481
-
482
- v0.3.4 (2013-10-23)
483
- -------------------
484
- [new] Queries with input and output parameters.
485
-
486
- v0.3.3 (2013-10-23)
487
- -------------------
488
- [new] Test connection when tedious pool is created.
489
-
490
- v0.3.2 (2013-09-30)
491
- -------------------
492
- [new] Added support for multiple connections.
493
-
494
- v0.3.1 (2013-09-13)
495
- -------------------
496
- [fix] NaN values of input parameters are automatically converted to null.
497
-
498
- v0.3.0 (2013-09-08)
499
- -------------------
500
- [new] Documentation extended
501
- [new] Microsoft Driver for Node.js for SQL Server is now available as an optional TDS driver.
502
- [new] Metadata are now accesible trough recordset.columns property.
503
- [new] Support for multiple recordsets in query.
504
- [fix] SQL null values are now correctly casted as JS null.
505
- [change] Default SQL data type for JS Number is now sql.Int (was sql.BigInt).
506
-
507
- v0.2.5 (2013-09-05)
508
- -------------------
509
- [fix] Multiple columns with identical name in same recordset are now handled correctly.
510
-
511
- v0.2.4 (2013-08-15)
512
- -------------------
513
- [fix] Errors are now instance of Error.
514
- [fix] Empty recordsets fixed.
515
-
516
- v0.2.3 (2013-08-14)
517
- -------------------
518
- [new] Verbose mode for query.
519
-
520
- v0.2.2 (2013-08-11)
521
- -------------------
522
- [new] Verbose mode for stored procedure.
523
- [fix] Null values fixed.
524
-
525
- v0.2.0 (2013-08-10)
526
- -------------------
527
- [change] Project was renamed from xsp-mssql to node-mssql.
528
- [fix] Some minor bug fixes.
529
-
530
- v0.1.0 (2013-07-10)
531
- -------------------
532
- Initial release.
package/test.js DELETED
@@ -1,40 +0,0 @@
1
- 'use strict'
2
- const mssql = require('./')
3
- const { v4: uuid } = require('uuid')
4
-
5
- const [, , max] = process.argv;
6
-
7
- const sqlConfig = {
8
- password: 'Upper_l0wercase',
9
- database: 'di_production',
10
- stream: false,
11
- // driver: 'msnodesqlv8',
12
- options: {
13
- // trustedConnection: true,
14
- trustServerCertificate: true,
15
- enableArithAbort: true,
16
- encrypt: true,
17
- // abortTransactionOnError: false,
18
- },
19
- pool: {
20
- max: max ? parseInt(max) : 10,
21
- min: 0,
22
- },
23
- port: 1433,
24
- user: 'sa',
25
- server: 'localhost',
26
- };
27
-
28
- (async () => {
29
- const pools = await Promise.all(Array.from(new Array(100)).map(() => {
30
- return new mssql.ConnectionPool(sqlConfig).connect()
31
- }))
32
- setInterval(async () => {
33
- const pool = pools[Math.floor(Math.random() * pools.length)]
34
- const ps = new mssql.PreparedStatement(pool)
35
- ps.input('tempParam', mssql.TYPES.NVarChar)
36
- await ps.prepare('SELECT TOP 10 * FROM [debug] WHERE [tempData] = @tempParam')
37
- await ps.execute({ tempParam: '{}' })
38
- await ps.unprepare()
39
- }, 100)
40
- })()
package/test2.js DELETED
@@ -1,211 +0,0 @@
1
- const values = [
2
- 1810,
3
- 1729,
4
- 1857,
5
- 1777,
6
- 1927,
7
- 1936,
8
- 1797,
9
- 1719,
10
- 1703,
11
- 1758,
12
- 1768,
13
- 2008,
14
- 1963,
15
- 1925,
16
- 1919,
17
- 1911,
18
- 1782,
19
- 2001,
20
- 1744,
21
- 1738,
22
- 1742,
23
- 1799,
24
- 1765,
25
- 1819,
26
- 1888,
27
- 127,
28
- 1880,
29
- 1984,
30
- 1697,
31
- 1760,
32
- 1680,
33
- 1951,
34
- 1745,
35
- 1817,
36
- 1704,
37
- 1736,
38
- 1969,
39
- 1705,
40
- 1690,
41
- 1848,
42
- 1885,
43
- 1912,
44
- 1982,
45
- 1895,
46
- 1959,
47
- 1769,
48
- 1722,
49
- 1807,
50
- 1901,
51
- 1983,
52
- 1993,
53
- 1871,
54
- 1795,
55
- 1955,
56
- 1921,
57
- 1934,
58
- 1743,
59
- 1899,
60
- 1942,
61
- 1964,
62
- 1034,
63
- 1952,
64
- 1851,
65
- 1716,
66
- 1800,
67
- 1771,
68
- 1945,
69
- 1877,
70
- 1917,
71
- 1930,
72
- 1970,
73
- 1948,
74
- 1914,
75
- 1767,
76
- 1910,
77
- 563,
78
- 1121,
79
- 1897,
80
- 1946,
81
- 1882,
82
- 1739,
83
- 1900,
84
- 1714,
85
- 1931,
86
- 2000,
87
- 311,
88
- 1881,
89
- 1876,
90
- 354,
91
- 1965,
92
- 1842,
93
- 1979,
94
- 1998,
95
- 1960,
96
- 1852,
97
- 1847,
98
- 1938,
99
- 1369,
100
- 1780,
101
- 1698,
102
- 1753,
103
- 1746,
104
- 1868,
105
- 1752,
106
- 1802,
107
- 1892,
108
- 1755,
109
- 1818,
110
- 1913,
111
- 1706,
112
- 1862,
113
- 326,
114
- 1941,
115
- 1926,
116
- 1809,
117
- 1879,
118
- 1815,
119
- 1939,
120
- 1859,
121
- 1999,
122
- 1947,
123
- 1898,
124
- 1794,
125
- 1737,
126
- 1971,
127
- 1977,
128
- 1944,
129
- 1812,
130
- 1905,
131
- 1359,
132
- 1788,
133
- 1754,
134
- 1774,
135
- 1825,
136
- 1748,
137
- 1701,
138
- 1791,
139
- 1786,
140
- 1692,
141
- 1894,
142
- 1961,
143
- 1902,
144
- 1849,
145
- 1967,
146
- 1770,
147
- 1987,
148
- 1831,
149
- 1728,
150
- 1896,
151
- 1805,
152
- 1733,
153
- 1918,
154
- 1731,
155
- 661,
156
- 1776,
157
- 1494,
158
- 2005,
159
- 2009,
160
- 2004,
161
- 1915,
162
- 1695,
163
- 1710,
164
- 1804,
165
- 1929,
166
- 1725,
167
- 1772,
168
- 1933,
169
- 609,
170
- 1708,
171
- 1822,
172
- 1978,
173
- 1811,
174
- 1816,
175
- 1073,
176
- 1874,
177
- 1845,
178
- 1989,
179
- 1696,
180
- 1953,
181
- 1823,
182
- 1923,
183
- 1907,
184
- 1834,
185
- 1806,
186
- 1861,
187
- 1785,
188
- 297,
189
- 1968,
190
- 1764,
191
- 1932,
192
- 1937,
193
- 1826,
194
- 1732,
195
- 1962,
196
- 1916,
197
- 1756,
198
- 1975,
199
- 1775,
200
- 1922,
201
- 1773
202
- ]
203
-
204
- values.forEach((first) => {
205
- values.forEach((second) => {
206
- const third = 2020 - first - second
207
- if (values.includes(third)) {
208
- console.log(first * second * third)
209
- }
210
- })
211
- })