mssql 6.4.0 → 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
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,12 +21,12 @@
21
21
  "azure",
22
22
  "node-mssql"
23
23
  ],
24
- "version": "6.4.0",
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.2",
29
+ "debug": "^4.3.3",
30
30
  "tarn": "^1.1.5",
31
31
  "tedious": "^6.7.1"
32
32
  },
package/CHANGELOG.txt DELETED
@@ -1,545 +0,0 @@
1
- v6.4.0 (2021-11-18)
2
- -------------------
3
- [new] Transaction/PreparedStatements expose the config from their parent connection
4
- [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))
5
-
6
- v6.3.2 (2021-05-13)
7
- -------------------
8
- [fix] Bump various dependencies for security fixes
9
-
10
- v6.3.1 (2021-01-01)
11
- -------------------
12
- [fix] Ensure line endings are unix style (LF)
13
-
14
- v6.3.0 (2020-12-14)
15
- -------------------
16
- [new] Result sets with duplicate keys can now be handled using `request.arrayRowMode` ([#1130](https://github.com/tediousjs/node-mssql/pull/1130))
17
- [fix] Issue with geography v2 parsing resolve ([#1138](https://github.com/tediousjs/node-mssql/pull/1138))
18
- [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))
19
-
20
- v6.2.3 (2020-09-25)
21
- -------------------
22
- [fix] Remove reference to global pool on connection error ([#1107](https://github.com/tediousjs/node-mssql/pull/1107))
23
- [fix] Trailing rows from request streams using msnodesqlv8 driver fail to be emitted ([#1109](https://github.com/tediousjs/node-mssql/pull/1109))
24
-
25
- v6.2.2 (2020-09-18)
26
- -------------------
27
- [fix] Avoid using deprecated `.inspect` on Objects ([#1071](https://github.com/tediousjs/node-mssql/pull/1071))
28
- [fix] Bump various dependencies for security fixes ([#1102](https://github.com/tediousjs/node-mssql/pull/1102))
29
-
30
- v6.2.1 (2020-07-22)
31
- -------------------
32
- [fix] Bump various dependencies for security fixes
33
-
34
- v6.2.0 (2020-03-13)
35
- -------------------
36
- [new] Set default isolationLevel for all transactions ([#1005](https://github.com/tediousjs/node-mssql/pull/1005))
37
- [new] sql.Date now is coerced into a date object ([#1007](https://github.com/tediousjs/node-mssql/pull/1007))
38
- [fix] Bump acorn dependency for security fix
39
-
40
- v6.1.0 (2020-02-17)
41
- -------------------
42
- [new] Add `Request.template` helper for providing templated strings to queries ([#960](https://github.com/tediousjs/node-mssql/pull/960))
43
- [new] Repeat calls to `ConnectionPool.connect()` resolve ([#941](https://github.com/tediousjs/node-mssql/pull/941))
44
- [new] Stored procedure params are now logged to debug log ([#979](https://github.com/tediousjs/node-mssql/pull/979))
45
- [fix] Repeat calls to `mssql.connect()` will now resolve correctly ([#986](https://github.com/tediousjs/node-mssql/pull/986))
46
- [fix] Connections are encrypted by default as documented ([#977](https://github.com/tediousjs/node-mssql/pull/977))
47
- [fix] Tagged template literal queries with empty array values now work ([#990](https://github.com/tediousjs/node-mssql/pull/990))
48
-
49
- v6.0.1 (2019-11-15)
50
- -------------------
51
- [fix] Fix an issue with connection strings where usernames have url encoded values ([#945](https://github.com/tediousjs/node-mssql/pull/945)
52
-
53
- v6.0.0 (2019-11-05)
54
- -------------------
55
- [fix] Fixed bug when trying to bulk insert columns that were `NVarChar(MAX)` ([#901](https://github.com/tediousjs/node-mssql/pull/901))
56
- [fix] Fixed an issue where Object prototype pollution could cause errors ([#879](https://github.com/tediousjs/node-mssql/pull/879))
57
- [fix] Fixed an issue where Request.input didn't validate against 0 parameters being passed ([#885](https://github.com/tediousjs/node-mssql/pull/885))
58
- [new] Implement pause/resume for msnodesqlv8 driver ([#877](https://github.com/tediousjs/node-mssql/pull/877))
59
- [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))
60
- [new] Invalid isolation levels passed to transactions will now throw an error
61
- [new] Duplicate parameter names in queries/stored procedures will now throw an error
62
- [new] `replaceInput` and `replaceOutput` functions added to `Request` and `PreparedStatement` to facilitate replacing existing parameters
63
- [new] Calls to the global `connect` function will return the global connection if it exists
64
- [new] Bulk table inserts now attempt to coerce Date objects out of non Date values
65
- [change] Closing the global connection by reference will now cleanup the internally managed globalConnection
66
- [change] Upgraded tedious to v6 ([#818](https://github.com/tediousjs/node-mssql/pull/818) and [#933](https://github.com/tediousjs/node-mssql/pull/933))
67
- [change] Upgraded msnodesqlv8 support to v0.7 ([#877](https://github.com/tediousjs/node-mssql/pull/877))
68
- [change] Remove references to deprecated `TYPES.Null` from tedious
69
- [change] `options.encrypt` is now set to true by default
70
- [change] Upgraded `debug` dependency to v4
71
- [change] Config objects are cloned so that the original object is not modified
72
- [change] Replaced pool library (`generic-pool`) with `tarn.js` ([#808](https://github.com/tediousjs/node-mssql/pull/808))
73
- [removed] Backoff try strategy for creating connections removed, `tarn.js` built-in retry strategy used instead
74
-
75
- v5.1.5 (2021-05-13)
76
- -------------------
77
- [fix] Bump various dependencies for security fixes
78
-
79
- v5.1.4 (2021-01-01)
80
- -------------------
81
- [fix] Ensure line endings are unix style (LF)
82
-
83
- v5.1.3 (2020-09-18)
84
- -------------------
85
- [fix] Avoid using deprecated `.inspect` on Objects ([#1071](https://github.com/tediousjs/node-mssql/pull/1071))
86
- [fix] Bump various dependencies for security fixes ([#1102](https://github.com/tediousjs/node-mssql/pull/1102))
87
-
88
- v5.1.2 (2020-07-22)
89
- -------------------
90
- [fix] Bump various dependencies for security fixes
91
-
92
- v5.1.1 (2020-03-13)
93
- -------------------
94
- [fix] Bump acorn dependency for security fix
95
-
96
- v5.1.0 (2019-04-17)
97
- -------------------
98
- [new] Add readOnlyIntent to connection string parser ([#853](https://github.com/tediousjs/node-mssql/pull/853))
99
-
100
- v5.0.6 (2019-04-17)
101
- -------------------
102
- [fix] Ensure callbacks don't block the event loop by executing them with `setImmediate` ([#855](https://github.com/tediousjs/node-mssql/pull/855))
103
-
104
- v5.0.5 (2019-03-28)
105
- -------------------
106
- [fix] Fix an issue where connections that error can deplete the pool ([#842](https://github.com/tediousjs/node-mssql/pull/842))
107
-
108
- v5.0.4 (2019-03-27)
109
- -------------------
110
- [fix] Fix a bug where msnodesqlv8 driver could execute callbacks twice ([#834](https://github.com/tediousjs/node-mssql/pull/834))
111
- [fix] npm audit fix on vulnerable dependencies
112
-
113
- v5.0.3 (2019-03-13)
114
- -------------------
115
- [fix] Fix a bug with streamed requests that start paused ([#833](https://github.com/tediousjs/node-mssql/pull/833))
116
-
117
- v5.0.2 (2019-03-09)
118
- -------------------
119
- [change] Remove references to deprecated `TYPES.Null` from tedious
120
-
121
- v5.0.1 (2019-03-09)
122
- -------------------
123
- [change] Config objects are cloned so that the original object is not modified
124
-
125
- v5.0.0 (2019-03-07)
126
- -------------------
127
- [new] Added pause / resume feature to streamed requests ([#775](https://github.com/tediousjs/node-mssql/pull/775))
128
- [new] Added options argument to bulk requests for compatibility with tedious driver
129
- [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)
130
- [change] Updated to latest Tedious 4.1.1
131
- [removed] Node.js < 6 is no longer supported
132
- [removed] Support dropped for deprecated tedious configuration values and types
133
-
134
- v4.3.9 (2020-07-22)
135
- -------------------
136
- [fix] Bump various dependencies for security fixes
137
-
138
- v4.3.8 (2020-03-13)
139
- -------------------
140
- [fix] Bump acorn dependency for security fix
141
-
142
- v4.3.7 (2019-03-29)
143
- -------------------
144
- [fix] Fix an issue where connections that error can deplete the pool ([#842](https://github.com/tediousjs/node-mssql/pull/842))
145
-
146
- v4.3.6 (2019-03-27)
147
- -------------------
148
- [fix] Fix a bug where msnodesqlv8 driver could execute callbacks twice ([#834](https://github.com/tediousjs/node-mssql/pull/834))
149
- [fix] Bump js-yaml dependency for security fix
150
-
151
- v4.3.5 (2019-03-09)
152
- -------------------
153
- [change] Remove references to deprecated `TYPES.Null` from tedious
154
-
155
- v4.3.4 (2019-03-09)
156
- -------------------
157
- [change] Config objects are cloned so that the original object is not modified
158
-
159
- v4.3.3 (2019-03-07)
160
- -------------------
161
- [change] Updated to latest generic-pool 3.6.1
162
-
163
- v4.3.0 (2018-11-20)
164
- -------------------
165
- [new] Add beforeConnect handler
166
- [change] Interpret connection timeout in seconds (not milliseconds)
167
-
168
- v4.2.3 (2018-11-03)
169
- -------------------
170
- [new] Add info event for execute function
171
- [fix] Fix JSON parsing with empty recordsets
172
- [new] Array / string literal template query preparation fixes
173
- [new] Passing encrypt option from mssql connection options to tedious options
174
- [change] Return the _poolDestroy promise before connecting again
175
-
176
- v4.2.2 (2018-10-17)
177
- -------------------
178
- [change] Updated to latest Tedious 2.7.1
179
-
180
- v4.2.1 (2018-08-05)
181
- -------------------
182
- [fix] Fix connections in the pool depleting due to unfulfilled Promises and timeouts
183
- [change] Updated to latest Tedious 2.6.4
184
-
185
- v4.2.0 (2018-07-05)
186
- -------------------
187
- [new] Added TVP support for msnodesqlv8 driver
188
- [new] Added support for information messages in msnodesqlv8 driver
189
- [new] Added support for request cancellation in msnodesqlv8 driver
190
- [fix] Fixed Tedious deprecation warnings
191
- [fix] Fixed ResourceRequest timed out error
192
- [fix] All query and batch methods now have the same interface
193
- [fix] Fixed msnodesqlv8 issue where the encrypt option was getting ignored
194
- [change] Updated to latest Tedious 2.3.1
195
-
196
- v4.1.0 (2017-09-29)
197
- -------------------
198
- [new] Adding support for the MultiSubnetFailover option in connection strings (Paul Kehrer)
199
- [new] Add request timeout support for msnodesqlv8 queries (Michael Parque)
200
- [fix] Fix type inference of non-integer numbers (Andrew Crites)
201
- [fix] Set acquireTimeout on generic pool (Karl Wiggisser)
202
-
203
- v4.0.4 (2017-04-25)
204
- -------------------
205
- [fix] Fix auto-closing of idle connections
206
-
207
- v4.0.3 (2017-04-25)
208
- -------------------
209
- [fix] Fixed broken CLI & debugging
210
-
211
- v4.0.2 (2017-04-19)
212
- -------------------
213
- [fix] Fixed broken JSON parser
214
-
215
- v4.0.1 (2017-04-02)
216
- -------------------
217
- [fix] Fixed stream in pipe mode
218
-
219
- v4.0.0 (2017-04-01)
220
- -------------------
221
- [new] Completly rewritten to ES6
222
- [new] Library is now compatible with Webpack
223
- [new] Library is ready for async/await
224
- [change] Removed support for < Node.js 4
225
- [change] Removed support for outdated node-tds and msnodesql drivers
226
- [change] Removed require('mssql/nofix') syntax
227
- [change] Removed verbose and debug mode
228
- [change] Removed 'driver' from options
229
- [change] Removed Transaction and Prepared Statement queues
230
- [change] Removed 'multiple' directive
231
- [change] Connection renamed to ConnectionPool
232
- [change] Updated to latest Tedious 2.0.0
233
-
234
- v3.3.0 (2016-05-06)
235
- -------------------
236
- [new] Added support for receiving informational messages
237
- [new] Added JSON support for msnodesql and msnodesqlv8 drivers
238
- [fix] Minor fixes in connection string parsing
239
-
240
- v3.2.1 (2016-04-16)
241
- -------------------
242
- [fix] Added PreparedStatement.lastRequest to access internal Request when using Promises
243
-
244
- v3.2.0 (2016-04-11)
245
- -------------------
246
- [new] Added experimental support for ES6 tagged template literals
247
- [new] Added support for Variant data type
248
- [change] Updated to latest Tedious 1.14.0
249
-
250
- v3.1.2 (2016-03-08)
251
- -------------------
252
- [fix] Correctly release connection after transaction error
253
-
254
- v3.1.1 (2016-02-21)
255
- -------------------
256
- [change] Minor internal changes because of connect-mssql module
257
-
258
- v3.1.0 (2016-02-13)
259
- -------------------
260
- [new] Added support for creating columns with primary keys in TVP Tables
261
-
262
- v3.0.1 (2016-02-04)
263
- -------------------
264
- [fix] Fix error causing app to crash when parsing json/xml from stored procedure
265
- [fix] Correctly check connection health after socket error
266
-
267
- v3.0.0 (2016-01-08)
268
- -------------------
269
- [new] Version bump because of breakinch change introduced in release 2.6
270
-
271
- v2.6.2 (2015-12-25) - unpublished from npm
272
- -------------------
273
- [new] Added support for receiving number of affected rows
274
- [new] Automatically concat chunks of FOR XML / FOR JSON recordset
275
- [fix] Correctly preserve domains
276
-
277
- v2.5.0 (2015-12-17)
278
- -------------------
279
- [new] Added support for new TDS driver msnodesqlv8
280
- [new] Support for configs formated as Connection String, Connection String URI
281
-
282
- v2.4.0 (2015-12-11)
283
- -------------------
284
- [new] Connection.connect, PreparedStatement.prepare and Transaction.begin now returns instance of itself as a first argument to Promise resolver.
285
- [fix] Correctly handle Socket Errors inside Requests (Jørgen Elgaard Larsen)
286
-
287
- v2.3.2 (2015-11-11)
288
- -------------------
289
- [change] Updated to latest Tedious 1.13.1
290
-
291
- v2.3.1 (2015-09-21)
292
- -------------------
293
- [fix] JSON fixes
294
-
295
- v2.3.0 (2015-09-20)
296
- -------------------
297
- [new] Experimental JSON support
298
-
299
- v2.2.1 (2015-09-19)
300
- -------------------
301
- [change] Updated to latest Tedious 1.12.3
302
- [fix] Promise not returns rowCount in bulk load (Ben Farr)
303
-
304
- v2.2.0 (2015-08-17)
305
- -------------------
306
- [new] Added column metadata identity, caseSensitive and readOnly (nino-porcino)
307
-
308
- v2.1.8 (2015-08-11)
309
- -------------------
310
- [change] Updated to latest Tedious 1.12.2
311
-
312
- v2.1.7 (2015-08-09)
313
- -------------------
314
- [change] Updated to latest Tedious 1.11.4
315
-
316
- v2.1.6 (2015-06-17)
317
- -------------------
318
- [change] Updated to latest Tedious 1.11.2
319
-
320
- v2.1.5 (2015-06-05)
321
- -------------------
322
- [fix] Correctly resolve database and schema name from table path.
323
-
324
- v2.1.4 (2015-06-05)
325
- -------------------
326
- [new] Better test coverage, automated integration tests.
327
- [fix] msnodesql: Manual transaction aborting.
328
- [fix] msnodesql: Tests.
329
-
330
- v2.1.3 (2015-05-03)
331
- -------------------
332
- [fix] msnodesql: Release connection to pool on query error (Farhan Khan)
333
-
334
- v2.1.2 (2015-03-28)
335
- -------------------
336
- [fix] Fix name parsing in Table constructor (David Mercer)
337
-
338
- v2.1.1 (2015-02-25)
339
- -------------------
340
- [fix] Fix Promise in Prepared Statement
341
-
342
- v2.1.0 (2015-02-20)
343
- -------------------
344
- [new] Detailed SQL errors
345
- [fix] Precise detection of column data types
346
-
347
- v2.0.0 (2015-02-17)
348
- -------------------
349
- [change] Updated to latest Tedious 1.10.0
350
- [new] Promises
351
- [new] Pipe request to object stream
352
- [new] Integrated type checks
353
- [new] CLI
354
- [fix] Transaction Abort Handling
355
- [fix] Allow rollback on transaction with queued requests
356
- [fix] Connection pool fixes
357
- [fix] Minor fixes
358
-
359
- v1.3.0 (2014-10-27)
360
- -------------------
361
- [change] Updated to latest Tedious 1.7.0
362
- [new] Tedious: Char and NChar types are now available as input parameters
363
-
364
- v1.2.1 (2014-10-07)
365
- -------------------
366
- [change] Updated to latest Tedious 1.5.3
367
-
368
- v1.2.0 (2014-08-26)
369
- -------------------
370
- [change] Updated to latest Tedious 1.4.0
371
- [new] Added support for bulk insert.
372
-
373
- v1.1.1 (2014-08-07)
374
- -------------------
375
- [new] Added column index to recordset metadata.
376
- [fix] Minor fixes in Tedious driver
377
-
378
- v1.1.0 (2014-07-13)
379
- -------------------
380
- [change] Updated to latest Tedious 1.1.0
381
- [new] Added support for domain logins (NTLM)
382
-
383
- v1.0.2 (2014-07-04)
384
- -------------------
385
- [new] Added support for input and output parameters in batch method.
386
- [new] Added checks for SQL injection in parameter names
387
-
388
- v1.0.1 (2014-07-04)
389
- -------------------
390
- [new] Added support for Streaming in Prepared Statements
391
-
392
- v1.0.0 (2014-07-04)
393
- -------------------
394
- [new] Start of semantic versioning, and commitment to stable API until 2.0.0
395
-
396
- v0.6.2 (2014-07-04)
397
- -------------------
398
- [new] Added batch() method to execute sql commands like "create procedure"
399
- [new] Cancel request in node-tds driver
400
- [fix] Fixed VarChar/NVarChar/VarBinary MAX in prepared statements
401
-
402
- v0.6.1 (2014-07-04)
403
- -------------------
404
- [change] TDS debugging simplified
405
-
406
- v0.6.0 (2014-07-03)
407
- -------------------
408
- [change] Updated to latest Tedious 1.0.0
409
- [new] Added support for Streaming
410
- [new] Added option to set request timeout (config.requestTimeout = 15000)
411
- [new] Errors documented
412
- [change] Connection timeout renamed from config.timeout to config.connectionTimeout
413
- [fix] Minor bug fixes
414
-
415
- v0.5.5 (2014-06-24)
416
- -------------------
417
- [fix] Failed login left open connection pool
418
-
419
- v0.5.4 (2014-06-15)
420
- -------------------
421
- [new] Multiple errors handling
422
-
423
- v0.5.3 (2014-04-04)
424
- -------------------
425
- [fix] Multiple recordsets in Prepared Statements
426
-
427
- v0.5.2 (2014-04-04)
428
- -------------------
429
- [new] Support for Prepared Statements
430
- [fix] Fixed order of output parameters
431
- [fix] Minor fixes in node-tds driver
432
-
433
- v0.5.1 (2014-04-01)
434
- -------------------
435
- [change] Updated to new Tedious 0.2.1
436
- [new] You can now easily setup type's length/scale (sql.VarChar(50))
437
- [new] Serialization of Geography and Geometry CLR types
438
- [new] Support for creating Table-Value Parameters (var tvp = new sql.Table())
439
- [new] Output parameters are now Input-Output and can handle initial value
440
- [new] Option to choose whether to pass/receive times in UTC or local time
441
- [new] Connecting to named instances simplified
442
- [change] Default SQL data type for JS String type is now NVarChar (was VarChar)
443
-
444
- v0.5.0 (2014-01-25)
445
- -------------------
446
- [new] You can now attach event listeners to Connection (connect, close), Transaction (begin, commit, rollback) and Request (row, recordset, done)
447
- [new] You can now set length of Char, NChar and Binary output parameters
448
- [new] You can now change default transaction isolation level
449
- [change] Errors are now splitted to three categories for better error handling - ConnectionError, TransactionError, ReqestError
450
- [new] Tedious: Binary and VarBinary types are now available as input and output parameters
451
- [new] Tedious: Image type is now available as input parameter
452
- [change] Tedious: Binary, VarBinary and Image types are now returned as buffer (was byte array)
453
- [change] Tedious: Transaction isolationLevel default is now READ_COMMITED (was READ_UNCOMMITED)
454
- [fix] Tedious: Fixed issue when zero value was casted as null when using BigInt as input parameter
455
- [fix] Tedious: Fixed issue when dates before 1900/01/01 in input parameters resulted in "Out of bounds" error
456
- [new] node-tds: UniqueIdentifier type in now available as input and output parameter
457
- [fix] node-tds: UniqueIdentifier type is now parsed correctly as string value (was buffer)
458
- [fix] node-tds: Text, NText, Char, NChar, VarChar and NVarChar input parameters has correct lengths
459
- [fix] node-tds: Fixed Error messages
460
- [fix] Msnodesql: Char, NChar, Xml, Text, NText and VarBinary types are now correctly functional as output parameters
461
-
462
- v0.4.5 (2014-01-23)
463
- -------------------
464
- [new] Added support for "co" flow controller via co-mssql module
465
-
466
- v0.4.4 (2014-01-22)
467
- -------------------
468
- [change] returnValue also accessible as property of recordsets
469
-
470
- v0.4.3 (2014-01-14)
471
- -------------------
472
- [fix] Even better network error handling in tedious
473
- [new] Module is compatible with Node.js 0.11
474
-
475
- v0.4.2 (2014-01-06)
476
- -------------------
477
- [new] Added connection timeout for node-tds
478
- [fix] Module now handle tedious network errors correctly
479
- [fix] Connection pool now destroy failed connections correctly
480
- [fix] Connection to instance name via tedious now works correctly
481
- [change] Option 'timeout' is now common option for all drivers (see documentation)
482
-
483
- v0.4.1 (2013-12-13)
484
- -------------------
485
- [fix] Filter empty recordsets when NOCOUNT is OFF
486
-
487
- v0.4.0 (2013-12-12)
488
- -------------------
489
- [new] Added support for transactions.
490
- [new] node-tds is now available as an optional TDS driver.
491
- [new] Documentation updated to CSDoc spec.
492
- [change] Tedious driver no longer use tedious-connection-pool for connection pooling
493
- [change] Msnodesql is now pooled
494
-
495
- v0.3.4 (2013-10-23)
496
- -------------------
497
- [new] Queries with input and output parameters.
498
-
499
- v0.3.3 (2013-10-23)
500
- -------------------
501
- [new] Test connection when tedious pool is created.
502
-
503
- v0.3.2 (2013-09-30)
504
- -------------------
505
- [new] Added support for multiple connections.
506
-
507
- v0.3.1 (2013-09-13)
508
- -------------------
509
- [fix] NaN values of input parameters are automatically converted to null.
510
-
511
- v0.3.0 (2013-09-08)
512
- -------------------
513
- [new] Documentation extended
514
- [new] Microsoft Driver for Node.js for SQL Server is now available as an optional TDS driver.
515
- [new] Metadata are now accesible trough recordset.columns property.
516
- [new] Support for multiple recordsets in query.
517
- [fix] SQL null values are now correctly casted as JS null.
518
- [change] Default SQL data type for JS Number is now sql.Int (was sql.BigInt).
519
-
520
- v0.2.5 (2013-09-05)
521
- -------------------
522
- [fix] Multiple columns with identical name in same recordset are now handled correctly.
523
-
524
- v0.2.4 (2013-08-15)
525
- -------------------
526
- [fix] Errors are now instance of Error.
527
- [fix] Empty recordsets fixed.
528
-
529
- v0.2.3 (2013-08-14)
530
- -------------------
531
- [new] Verbose mode for query.
532
-
533
- v0.2.2 (2013-08-11)
534
- -------------------
535
- [new] Verbose mode for stored procedure.
536
- [fix] Null values fixed.
537
-
538
- v0.2.0 (2013-08-10)
539
- -------------------
540
- [change] Project was renamed from xsp-mssql to node-mssql.
541
- [fix] Some minor bug fixes.
542
-
543
- v0.1.0 (2013-07-10)
544
- -------------------
545
- Initial release.
package/test.js DELETED
@@ -1,40 +0,0 @@
1
- 'use strict'
2
- const mssql = require('./')
3
-
4
- const [, , max] = process.argv
5
-
6
- const sqlConfig = {
7
- password: 'P@ssw0rd',
8
- database: 'test',
9
- stream: false,
10
- // driver: 'msnodesqlv8',
11
- options: {
12
- trustServerCertificate: true,
13
- enableArithAbort: true,
14
- encrypt: true,
15
- abortTransactionOnError: false
16
- },
17
- pool: {
18
- max: max ? parseInt(max) : 10,
19
- min: 0
20
- },
21
- port: 1433,
22
- user: 'sa',
23
- server: 'localhost',
24
- arrayRowMode: true
25
- }
26
-
27
- mssql.connect(sqlConfig).then((pool) => {
28
- console.log('Connected to SQL server')
29
- const request = pool.request()
30
- request.stream = true
31
- request.on('error', (err) => {
32
- console.error('good', err)
33
- })
34
- return request.query('SELECT * FROM nontable')
35
- }).catch((err) => {
36
- console.error('bad', err)
37
- }).then(() => {
38
- console.log('Disconnecting from SQL server')
39
- return mssql.close()
40
- }).then(() => console.log('Disconnected'))