Skip to content

Commit

Permalink
treat bigint as string in msnodesqlv8 driver
Browse files Browse the repository at this point in the history
  • Loading branch information
dhensby committed Apr 28, 2022
1 parent 8a2fc63 commit 6d5e44c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Unreleased
-------------------
[fix] BigInt type in nodemsqlv8 now treated as strings in parity with the tedious drive ([#1387](https://github.com/tediousjs/node-mssql/pull/1387))

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

v8.0.2 (2022-02-07)
Expand Down
2 changes: 2 additions & 0 deletions lib/msnodesqlv8/connection-pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ class ConnectionPool extends BaseConnectionPool {
return reject(err)
}

tds.setUseNumericString(true)

IDS.add(tds, 'Connection', connedtionId)
tds.setUseUTC(this.config.options.useUTC)
debug('connection(%d): established', IDS.get(tds))
Expand Down
2 changes: 1 addition & 1 deletion lib/msnodesqlv8/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const castParameter = function (value, type) {
case TYPES.NChar:
case TYPES.Xml:
case TYPES.Text:
case TYPES.BigInt:
case TYPES.NText:
if ((typeof value !== 'string') && !(value instanceof String)) {
value = value.toString()
Expand All @@ -39,7 +40,6 @@ const castParameter = function (value, type) {

case TYPES.Int:
case TYPES.TinyInt:
case TYPES.BigInt:
case TYPES.SmallInt:
if ((typeof value !== 'number') && !(value instanceof Number)) {
value = parseInt(value)
Expand Down

0 comments on commit 6d5e44c

Please sign in to comment.