mssql 11.0.1 → 12.1.0
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 +13 -2
- package/bin/mssql +3 -1
- package/index.js +2 -0
- package/lib/base/connection-pool.js +1 -2
- package/lib/base/request.js +7 -4
- package/lib/datatypes.js +1 -0
- package/lib/shared.js +1 -1
- package/lib/utils.js +2 -0
- package/msnodesqlv8.js +2 -0
- package/package.json +15 -9
- package/tedious.js +2 -0
package/README.md
CHANGED
|
@@ -351,7 +351,7 @@ sql.on('error', err => {
|
|
|
351
351
|
|
|
352
352
|
### Streaming
|
|
353
353
|
|
|
354
|
-
If you plan to work with large amount of rows, you should always use streaming. Once you enable this, you must listen for events to receive data.
|
|
354
|
+
If you plan to work with large amount of rows, you should always use streaming. Once you enable this, you must listen for events to receive data. Events must be attached before the query completes, but can be attached while in-flight.
|
|
355
355
|
|
|
356
356
|
```javascript
|
|
357
357
|
const sql = require('mssql')
|
|
@@ -361,7 +361,6 @@ sql.connect(config, err => {
|
|
|
361
361
|
|
|
362
362
|
const request = new sql.Request()
|
|
363
363
|
request.stream = true // You can set streaming differently for each request
|
|
364
|
-
request.query('select * from verylargetable') // or request.execute(procedure)
|
|
365
364
|
|
|
366
365
|
request.on('recordset', columns => {
|
|
367
366
|
// Emitted once for each recordset in a query
|
|
@@ -383,6 +382,8 @@ sql.connect(config, err => {
|
|
|
383
382
|
request.on('done', result => {
|
|
384
383
|
// Always emitted as the last one
|
|
385
384
|
})
|
|
385
|
+
|
|
386
|
+
request.query('select * from verylargetable') // or request.execute(procedure)
|
|
386
387
|
})
|
|
387
388
|
|
|
388
389
|
sql.on('error', err => {
|
|
@@ -2119,6 +2120,16 @@ request.query('select @myval as myval', (err, result) => {
|
|
|
2119
2120
|
- If you're facing problems with connecting SQL Server 2000, try setting the default TDS version to 7.1 with `config.options.tdsVersion = '7_1'` ([issue](https://github.com/tediousjs/node-mssql/issues/36))
|
|
2120
2121
|
- If you're executing a statement longer than 4000 chars on SQL Server 2000, always use [batch](#batch-batch-callback) instead of [query](#query-command-callback) ([issue](https://github.com/tediousjs/node-mssql/issues/68))
|
|
2121
2122
|
|
|
2123
|
+
## 10.x to 11.x changes
|
|
2124
|
+
|
|
2125
|
+
- Upgraded to tedious version 18
|
|
2126
|
+
- Dropped support for Node version <=16
|
|
2127
|
+
|
|
2128
|
+
## 9.x to 10.x changes
|
|
2129
|
+
|
|
2130
|
+
- Upgraded to tedious version 16
|
|
2131
|
+
- Dropped support for Node version <= 14
|
|
2132
|
+
|
|
2122
2133
|
## 8.x to 9.x changes
|
|
2123
2134
|
|
|
2124
2135
|
- Upgraded to tedious version 15
|
package/bin/mssql
CHANGED
|
@@ -30,7 +30,8 @@ async function resolveConfig (opts, cfgFile) {
|
|
|
30
30
|
const cfg = Object.entries({
|
|
31
31
|
options: {
|
|
32
32
|
encrypt: opts.encrypt,
|
|
33
|
-
trustServerCertificate: opts.trustServerCertificate
|
|
33
|
+
trustServerCertificate: opts.trustServerCertificate,
|
|
34
|
+
tdsVersion: opts.tdsVersion
|
|
34
35
|
},
|
|
35
36
|
user: opts.user,
|
|
36
37
|
password: opts.password,
|
|
@@ -79,6 +80,7 @@ program
|
|
|
79
80
|
.option('--password <password>', 'Password for the database connection')
|
|
80
81
|
.option('--server <server>', 'Server for the database connection')
|
|
81
82
|
.option('--database <database>', 'Database for the database connection')
|
|
83
|
+
.option('--tds-version <version>', 'TDS version to use for the database connection')
|
|
82
84
|
.option('--port <port>', 'Port for the database connection', parseInt)
|
|
83
85
|
.option('--encrypt', 'Use the encrypt option for this connection', false)
|
|
84
86
|
.option('--trust-server-certificate', 'Trust the server certificate for this connection', false)
|
package/index.js
CHANGED
|
@@ -7,7 +7,6 @@ const tarn = require('tarn')
|
|
|
7
7
|
const { IDS } = require('../utils')
|
|
8
8
|
const ConnectionError = require('../error/connection-error')
|
|
9
9
|
const shared = require('../shared')
|
|
10
|
-
const clone = require('rfdc/default')
|
|
11
10
|
const { MSSQLError } = require('../error')
|
|
12
11
|
|
|
13
12
|
/**
|
|
@@ -53,7 +52,7 @@ class ConnectionPool extends EventEmitter {
|
|
|
53
52
|
throw ex
|
|
54
53
|
}
|
|
55
54
|
} else {
|
|
56
|
-
this.config =
|
|
55
|
+
this.config = config
|
|
57
56
|
}
|
|
58
57
|
|
|
59
58
|
// set defaults
|
package/lib/base/request.js
CHANGED
|
@@ -53,6 +53,7 @@ class Request extends EventEmitter {
|
|
|
53
53
|
* @param {Template literal} template
|
|
54
54
|
* @return {String}
|
|
55
55
|
*/
|
|
56
|
+
|
|
56
57
|
template () {
|
|
57
58
|
const values = Array.prototype.slice.call(arguments)
|
|
58
59
|
const strings = values.shift()
|
|
@@ -101,7 +102,7 @@ class Request extends EventEmitter {
|
|
|
101
102
|
* Add an input parameter to the request.
|
|
102
103
|
*
|
|
103
104
|
* @param {String} name Name of the input parameter without @ char.
|
|
104
|
-
* @param {*} [type] SQL data type of input parameter. If you omit type, module
|
|
105
|
+
* @param {*} [type] SQL data type of input parameter. If you omit type, module automatically decides which SQL data type should be used based on JS data type.
|
|
105
106
|
* @param {*} value Input parameter value. `undefined` and `NaN` values are automatically converted to `null` values.
|
|
106
107
|
* @return {Request}
|
|
107
108
|
*/
|
|
@@ -147,7 +148,7 @@ class Request extends EventEmitter {
|
|
|
147
148
|
* Replace an input parameter on the request.
|
|
148
149
|
*
|
|
149
150
|
* @param {String} name Name of the input parameter without @ char.
|
|
150
|
-
* @param {*} [type] SQL data type of input parameter. If you omit type, module
|
|
151
|
+
* @param {*} [type] SQL data type of input parameter. If you omit type, module automatically decides which SQL data type should be used based on JS data type.
|
|
151
152
|
* @param {*} value Input parameter value. `undefined` and `NaN` values are automatically converted to `null` values.
|
|
152
153
|
* @return {Request}
|
|
153
154
|
*/
|
|
@@ -253,7 +254,7 @@ class Request extends EventEmitter {
|
|
|
253
254
|
return this
|
|
254
255
|
}
|
|
255
256
|
|
|
256
|
-
// Check
|
|
257
|
+
// Check if method was called as tagged template
|
|
257
258
|
if (typeof batch === 'object') {
|
|
258
259
|
const values = Array.prototype.slice.call(arguments)
|
|
259
260
|
const strings = values.shift()
|
|
@@ -376,6 +377,7 @@ class Request extends EventEmitter {
|
|
|
376
377
|
* @param {Object} streamOptions - optional options to configure the readable stream with like highWaterMark
|
|
377
378
|
* @return {Stream}
|
|
378
379
|
*/
|
|
380
|
+
|
|
379
381
|
toReadableStream (streamOptions = {}) {
|
|
380
382
|
this.stream = true
|
|
381
383
|
this.pause()
|
|
@@ -407,6 +409,7 @@ class Request extends EventEmitter {
|
|
|
407
409
|
* @param {Stream} stream Stream to pipe data into.
|
|
408
410
|
* @return {Stream}
|
|
409
411
|
*/
|
|
412
|
+
|
|
410
413
|
pipe (writableStream) {
|
|
411
414
|
const readableStream = this.toReadableStream()
|
|
412
415
|
return readableStream.pipe(writableStream)
|
|
@@ -450,7 +453,7 @@ class Request extends EventEmitter {
|
|
|
450
453
|
return this
|
|
451
454
|
}
|
|
452
455
|
|
|
453
|
-
// Check
|
|
456
|
+
// Check if method was called as tagged template
|
|
454
457
|
if (typeof command === 'object') {
|
|
455
458
|
const values = Array.prototype.slice.call(arguments)
|
|
456
459
|
const strings = values.shift()
|
package/lib/datatypes.js
CHANGED
package/lib/shared.js
CHANGED
package/lib/utils.js
CHANGED
package/msnodesqlv8.js
CHANGED
package/package.json
CHANGED
|
@@ -21,27 +21,33 @@
|
|
|
21
21
|
"azure",
|
|
22
22
|
"node-mssql"
|
|
23
23
|
],
|
|
24
|
-
"version": "
|
|
24
|
+
"version": "12.1.0",
|
|
25
25
|
"main": "index.js",
|
|
26
26
|
"type": "commonjs",
|
|
27
|
-
"repository":
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "git+https://github.com/tediousjs/node-mssql.git"
|
|
30
|
+
},
|
|
31
|
+
"homepage": "https://github.com/tediousjs/node-mssql#readme",
|
|
32
|
+
"bugs": {
|
|
33
|
+
"url": "https://github.com/tediousjs/node-mssql/issues"
|
|
34
|
+
},
|
|
28
35
|
"license": "MIT",
|
|
29
36
|
"dependencies": {
|
|
30
|
-
"@tediousjs/connection-string": "^0.
|
|
37
|
+
"@tediousjs/connection-string": "^0.6.0",
|
|
31
38
|
"commander": "^11.0.0",
|
|
32
39
|
"debug": "^4.3.3",
|
|
33
|
-
"rfdc": "^1.3.0",
|
|
34
40
|
"tarn": "^3.0.2",
|
|
35
|
-
"tedious": "^
|
|
41
|
+
"tedious": "^19.0.0"
|
|
36
42
|
},
|
|
37
43
|
"devDependencies": {
|
|
38
|
-
"@commitlint/cli": "^
|
|
39
|
-
"@commitlint/config-conventional": "^
|
|
44
|
+
"@commitlint/cli": "^20.0.0",
|
|
45
|
+
"@commitlint/config-conventional": "^20.0.0",
|
|
40
46
|
"@semantic-release/commit-analyzer": "^11.1.0",
|
|
41
47
|
"@semantic-release/github": "^9.2.6",
|
|
42
48
|
"@semantic-release/npm": "^11.0.3",
|
|
43
49
|
"@semantic-release/release-notes-generator": "^12.1.0",
|
|
44
|
-
"mocha": "^
|
|
50
|
+
"mocha": "^11.0.1",
|
|
45
51
|
"semantic-release": "^22.0.12",
|
|
46
52
|
"standard": "^17.0.0"
|
|
47
53
|
},
|
|
@@ -64,6 +70,6 @@
|
|
|
64
70
|
"test-cli": "mocha --exit -t 15000 test/common/cli.js"
|
|
65
71
|
},
|
|
66
72
|
"bin": {
|
|
67
|
-
"mssql": "
|
|
73
|
+
"mssql": "bin/mssql"
|
|
68
74
|
}
|
|
69
75
|
}
|
package/tedious.js
CHANGED