tedious 6.4.0 → 6.6.2
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/lib/bulk-load.js +17 -22
- package/lib/connection.js +363 -251
- package/lib/connector.js +3 -1
- package/lib/data-type.js +111 -109
- package/lib/data-types/bigint.js +19 -7
- package/lib/data-types/binary.js +19 -10
- package/lib/data-types/bit.js +14 -4
- package/lib/data-types/bitn.js +26 -3
- package/lib/data-types/char.js +26 -13
- package/lib/data-types/date.js +18 -9
- package/lib/data-types/datetime.js +23 -5
- package/lib/data-types/datetime2.js +10 -22
- package/lib/data-types/datetimen.js +26 -3
- package/lib/data-types/datetimeoffset.js +11 -22
- package/lib/data-types/decimal.js +14 -6
- package/lib/data-types/decimaln.js +26 -5
- package/lib/data-types/float.js +14 -4
- package/lib/data-types/floatn.js +26 -3
- package/lib/data-types/image.js +12 -5
- package/lib/data-types/int.js +14 -4
- package/lib/data-types/intn.js +26 -3
- package/lib/data-types/money.js +14 -4
- package/lib/data-types/moneyn.js +26 -3
- package/lib/data-types/nchar.js +17 -6
- package/lib/data-types/ntext.js +26 -5
- package/lib/data-types/null.js +27 -3
- package/lib/data-types/numeric.js +14 -6
- package/lib/data-types/numericn.js +26 -5
- package/lib/data-types/nvarchar.js +20 -11
- package/lib/data-types/real.js +14 -4
- package/lib/data-types/smalldatetime.js +14 -4
- package/lib/data-types/smallint.js +14 -4
- package/lib/data-types/smallmoney.js +14 -4
- package/lib/data-types/sql-variant.js +23 -4
- package/lib/data-types/text.js +13 -7
- package/lib/data-types/time.js +9 -21
- package/lib/data-types/tinyint.js +14 -4
- package/lib/data-types/tvp.js +12 -3
- package/lib/data-types/udt.js +26 -3
- package/lib/data-types/uniqueidentifier.js +12 -5
- package/lib/data-types/varbinary.js +18 -8
- package/lib/data-types/varchar.js +19 -10
- package/lib/data-types/xml.js +26 -3
- package/lib/debug.js +3 -1
- package/lib/guid-parser.js +6 -6
- package/lib/incoming-message-stream.js +10 -7
- package/lib/instance-lookup.js +12 -6
- package/lib/library.js +6 -1
- package/lib/login7-payload.js +2 -3
- package/lib/message-io.js +14 -3
- package/lib/message.js +2 -3
- package/lib/metadata-parser.js +259 -136
- package/lib/ntlm-payload.js +12 -21
- package/lib/outgoing-message-stream.js +7 -6
- package/lib/packet.js +4 -5
- package/lib/prelogin-payload.js +3 -4
- package/lib/request.js +11 -11
- package/lib/rpcrequest-payload.js +28 -22
- package/lib/sender.js +25 -11
- package/lib/special-stored-procedure.js +9 -2
- package/lib/tds-versions.js +8 -2
- package/lib/tedious.js +75 -9
- package/lib/token/colmetadata-token-parser.js +20 -10
- package/lib/token/done-token-parser.js +32 -25
- package/lib/token/env-change-token-parser.js +50 -20
- package/lib/token/feature-ext-ack-parser.js +19 -14
- package/lib/token/fedauth-info-parser.js +17 -11
- package/lib/token/infoerror-token-parser.js +14 -14
- package/lib/token/loginack-token-parser.js +21 -12
- package/lib/token/nbcrow-token-parser.js +35 -23
- package/lib/token/order-token-parser.js +14 -7
- package/lib/token/returnstatus-token-parser.js +14 -7
- package/lib/token/returnvalue-token-parser.js +22 -11
- package/lib/token/row-token-parser.js +34 -22
- package/lib/token/sspi-token-parser.js +14 -8
- package/lib/token/stream-parser.js +95 -36
- package/lib/token/token-stream-parser.js +16 -10
- package/lib/token/token.js +396 -2
- package/lib/tracking-buffer/writable-tracking-buffer.js +37 -5
- package/lib/transaction.js +25 -16
- package/lib/transient-error-lookup.js +6 -1
- package/lib/value-parser.js +412 -315
- package/package.json +24 -21
- package/pull_request_template.md +1 -1
- package/tsconfig.json +1 -1
- package/lib/tracking-buffer/bigint.js +0 -102
package/package.json
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"homepage": "https://github.com/tediousjs/tedious",
|
|
28
28
|
"bugs": "https://github.com/tediousjs/tedious/issues",
|
|
29
29
|
"license": "MIT",
|
|
30
|
-
"version": "6.
|
|
30
|
+
"version": "6.6.2",
|
|
31
31
|
"main": "./lib/tedious.js",
|
|
32
32
|
"repository": {
|
|
33
33
|
"type": "git",
|
|
@@ -40,41 +40,44 @@
|
|
|
40
40
|
"tag": "next"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@azure/ms-rest-nodeauth": "
|
|
44
|
-
"@types/node": "^12.
|
|
45
|
-
"
|
|
43
|
+
"@azure/ms-rest-nodeauth": "2.0.2",
|
|
44
|
+
"@types/node": "^12.7.11",
|
|
45
|
+
"@types/readable-stream": "^2.3.5",
|
|
46
46
|
"bl": "^3.0.0",
|
|
47
47
|
"depd": "^2.0.0",
|
|
48
|
-
"iconv-lite": "^0.
|
|
48
|
+
"iconv-lite": "^0.5.0",
|
|
49
|
+
"jsbi": "^3.1.1",
|
|
49
50
|
"native-duplexpair": "^1.0.0",
|
|
50
51
|
"punycode": "^2.1.0",
|
|
51
52
|
"readable-stream": "^3.4.0",
|
|
52
53
|
"sprintf-js": "^1.1.2"
|
|
53
54
|
},
|
|
54
55
|
"devDependencies": {
|
|
55
|
-
"@babel/cli": "^7.
|
|
56
|
-
"@babel/core": "^7.
|
|
57
|
-
"@babel/node": "^7.
|
|
58
|
-
"@babel/preset-env": "^7.
|
|
59
|
-
"@babel/preset-typescript": "^7.
|
|
60
|
-
"@babel/register": "^7.
|
|
61
|
-
"@commitlint/cli": "^8.
|
|
62
|
-
"@commitlint/config-conventional": "^8.
|
|
63
|
-
"@commitlint/travis-cli": "^8.
|
|
64
|
-
"
|
|
56
|
+
"@babel/cli": "^7.6.2",
|
|
57
|
+
"@babel/core": "^7.6.2",
|
|
58
|
+
"@babel/node": "^7.6.2",
|
|
59
|
+
"@babel/preset-env": "^7.6.2",
|
|
60
|
+
"@babel/preset-typescript": "^7.6.0",
|
|
61
|
+
"@babel/register": "^7.6.2",
|
|
62
|
+
"@commitlint/cli": "^8.2.0",
|
|
63
|
+
"@commitlint/config-conventional": "^8.2.0",
|
|
64
|
+
"@commitlint/travis-cli": "^8.2.0",
|
|
65
|
+
"@types/bl": "^2.1.0",
|
|
66
|
+
"@types/sprintf-js": "^1.1.2",
|
|
67
|
+
"async": "^2.6.3",
|
|
65
68
|
"babel-eslint": "^11.0.0-beta.0",
|
|
66
69
|
"babel-plugin-istanbul": "^5.2.0",
|
|
67
70
|
"benchmark": "^2.1.0",
|
|
68
71
|
"chai": "^4.1.2",
|
|
69
|
-
"codecov": "^3.
|
|
72
|
+
"codecov": "^3.6.1",
|
|
70
73
|
"eslint": "^5.16.0",
|
|
71
74
|
"mitm": "^1.7.0",
|
|
72
|
-
"mocha": "^6.1
|
|
75
|
+
"mocha": "^6.2.1",
|
|
73
76
|
"nyc": "^14.1.1",
|
|
74
|
-
"rimraf": "^
|
|
75
|
-
"semantic-release": "^15.13.
|
|
76
|
-
"sinon": "^7.
|
|
77
|
-
"typescript": "^3.6.
|
|
77
|
+
"rimraf": "^3.0.0",
|
|
78
|
+
"semantic-release": "^15.13.24",
|
|
79
|
+
"sinon": "^7.5.0",
|
|
80
|
+
"typescript": "^3.6.3"
|
|
78
81
|
},
|
|
79
82
|
"scripts": {
|
|
80
83
|
"lint": "eslint src test --ext .js,.ts && tsc",
|
package/pull_request_template.md
CHANGED
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
3. After bug fix/code change, ensure all the existing tests and new tests (if any) pass (`npm run-script test-all`). During development, to run individual test use `node_modules/nodeunit test/<test_file.js> -t <test_name>`.
|
|
5
5
|
4. Build the driver (`npm run build`).
|
|
6
6
|
5. Run eslint and flow typechecker (`npm run lint`).
|
|
7
|
-
6. Run commitlint (`node_modules/.bin/commitlint --from origin/master --to HEAD`). Refer [commit conventions](
|
|
7
|
+
6. Run commitlint (`node_modules/.bin/commitlint --from origin/master --to HEAD`). Refer [commit conventions](https://commitlint.js.org/#/concepts-commit-conventions) and [commit rules](https://commitlint.js.org/#/reference-rules).
|
|
8
8
|
|
|
9
9
|
**Thank you for Contributing!**
|
package/tsconfig.json
CHANGED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.convertLEBytesToString = convertLEBytesToString;
|
|
7
|
-
exports.numberToInt64LE = numberToInt64LE;
|
|
8
|
-
|
|
9
|
-
function isZero(array) {
|
|
10
|
-
for (let j = 0, len = array.length; j < len; j++) {
|
|
11
|
-
const byte = array[j];
|
|
12
|
-
|
|
13
|
-
if (byte !== 0) {
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
return true;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function getNextRemainder(array) {
|
|
22
|
-
let remainder = 0;
|
|
23
|
-
|
|
24
|
-
for (let i = array.length - 1; i >= 0; i--) {
|
|
25
|
-
const s = remainder * 256 + array[i];
|
|
26
|
-
array[i] = Math.floor(s / 10);
|
|
27
|
-
remainder = s % 10;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return remainder;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function invert(array) {
|
|
34
|
-
// Invert bits
|
|
35
|
-
const len = array.length;
|
|
36
|
-
|
|
37
|
-
for (let i = 0; i < len; i++) {
|
|
38
|
-
array[i] = array[i] ^ 0xFF;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
for (let i = 0; i < len; i++) {
|
|
42
|
-
array[i] = array[i] + 1;
|
|
43
|
-
|
|
44
|
-
if (array[i] > 255) {
|
|
45
|
-
array[i] = 0;
|
|
46
|
-
} else {
|
|
47
|
-
break;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function convertLEBytesToString(buffer) {
|
|
53
|
-
const array = Array.prototype.slice.call(buffer, 0, buffer.length);
|
|
54
|
-
|
|
55
|
-
if (isZero(array)) {
|
|
56
|
-
return '0';
|
|
57
|
-
} else {
|
|
58
|
-
let sign;
|
|
59
|
-
|
|
60
|
-
if (array[array.length - 1] & 0x80) {
|
|
61
|
-
sign = '-';
|
|
62
|
-
invert(array);
|
|
63
|
-
} else {
|
|
64
|
-
sign = '';
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
let result = '';
|
|
68
|
-
|
|
69
|
-
while (!isZero(array)) {
|
|
70
|
-
const t = getNextRemainder(array);
|
|
71
|
-
result = t + result;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
return sign + result;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function numberToInt64LE(num) {
|
|
79
|
-
// adapted from https://github.com/broofa/node-int64
|
|
80
|
-
const negate = num < 0;
|
|
81
|
-
let hi = Math.abs(num);
|
|
82
|
-
let lo = hi % 0x100000000;
|
|
83
|
-
hi = hi / 0x100000000 | 0;
|
|
84
|
-
const buf = Buffer.alloc(8, 0);
|
|
85
|
-
|
|
86
|
-
for (let i = 0; i <= 7; i++) {
|
|
87
|
-
buf[i] = lo & 0xff;
|
|
88
|
-
lo = i === 3 ? hi : lo >>> 8;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
if (negate) {
|
|
92
|
-
let carry = 1;
|
|
93
|
-
|
|
94
|
-
for (let i = 0; i <= 7; i++) {
|
|
95
|
-
const v = (buf[i] ^ 0xff) + carry;
|
|
96
|
-
buf[i] = v & 0xff;
|
|
97
|
-
carry = v >> 8;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
return buf;
|
|
102
|
-
}
|