Skip to content

Commit 6d5e44c

Browse files
committed
treat bigint as string in msnodesqlv8 driver
1 parent 8a2fc63 commit 6d5e44c

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,6 +1,10 @@
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
v8.1.0 (2022-04-06)
26
-------------------
3-
[new] MSSQL CLI tool now accepts some options to allow overriding config file ((#1381](https://github.com/tediousjs/node-mssql/pull/1381))
7+
[new] MSSQL CLI tool now accepts some options to allow overriding config file ([#1381](https://github.com/tediousjs/node-mssql/pull/1381))
48
[fix] nodemsqlv8 driver tests working against Node 10 ([#1368](https://github.com/tediousjs/node-mssql/pull/1368))
59

610
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
@@ -59,6 +59,8 @@ class ConnectionPool extends BaseConnectionPool {
5959
return reject(err)
6060
}
6161

62+
tds.setUseNumericString(true)
63+
6264
IDS.add(tds, 'Connection', connedtionId)
6365
tds.setUseUTC(this.config.options.useUTC)
6466
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)