Skip to content

Commit c4ca070

Browse files
committed
treat bigint as string in msnodesqlv8 driver
1 parent c40b64a commit c4ca070

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

CHANGELOG.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
Unreleased
2+
-------------------
3+
[fix] BigInt type in nodemsqlv8 now treated as strings in parity with the tedious drive ([#1387](https://github.com/tediousjs/node-mssql/pull/1387))
4+
15
v9.0.1 (2022-08-18)
26
-------------------
37
[fix] fix regression in requestTimout option not accepting `0` as a value ([#1421](https://github.com/tediousjs/node-mssql/pull/1421))
@@ -26,7 +30,7 @@ v8.1.1 (2022-05-18)
2630

2731
v8.1.0 (2022-04-06)
2832
-------------------
29-
[new] MSSQL CLI tool now accepts some options to allow overriding config file ((#1381](https://github.com/tediousjs/node-mssql/pull/1381))
33+
[new] MSSQL CLI tool now accepts some options to allow overriding config file ([#1381](https://github.com/tediousjs/node-mssql/pull/1381))
3034
[fix] nodemsqlv8 driver tests working against Node 10 ([#1368](https://github.com/tediousjs/node-mssql/pull/1368))
3135

3236
v8.0.2 (2022-02-07)

lib/msnodesqlv8/connection-pool.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ class ConnectionPool extends BaseConnectionPool {
5757
return reject(err)
5858
}
5959

60+
tds.setUseNumericString(true)
61+
6062
IDS.add(tds, 'Connection', connedtionId)
6163
tds.setUseUTC(this.config.options.useUTC)
6264
debug('connection(%d): established', IDS.get(tds))

lib/msnodesqlv8/request.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const castParameter = function (value, type) {
3131
case TYPES.NChar:
3232
case TYPES.Xml:
3333
case TYPES.Text:
34+
case TYPES.BigInt:
3435
case TYPES.NText:
3536
if ((typeof value !== 'string') && !(value instanceof String)) {
3637
value = value.toString()
@@ -39,7 +40,6 @@ const castParameter = function (value, type) {
3940

4041
case TYPES.Int:
4142
case TYPES.TinyInt:
42-
case TYPES.BigInt:
4343
case TYPES.SmallInt:
4444
if ((typeof value !== 'number') && !(value instanceof Number)) {
4545
value = parseInt(value)

0 commit comments

Comments
 (0)