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 Aug 19, 2022
1 parent c40b64a commit c4ca070
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,3 +1,7 @@
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))

v9.0.1 (2022-08-18)
-------------------
[fix] fix regression in requestTimout option not accepting `0` as a value ([#1421](https://github.com/tediousjs/node-mssql/pull/1421))
Expand Down Expand Up @@ -26,7 +30,7 @@ v8.1.1 (2022-05-18)

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 @@ -57,6 +57,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 c4ca070

Please sign in to comment.