node-mssql icon indicating copy to clipboard operation
node-mssql copied to clipboard

treat bigint as string in msnodesqlv8 driver

Open dhensby opened this issue 2 years ago • 6 comments

What this does:

BigInts should be treated as strings to ensure no precision loss

Related issues:

Attempt to fix #1385

Pre/Post merge checklist:

  • [x] Update change log

dhensby avatar Apr 19 '22 11:04 dhensby

Well, interestingly, the tedious driver does not allow strings to be used for bigints and instead they must be set to varchars...

dhensby avatar Apr 19 '22 16:04 dhensby

Would there be an argument for using JS's BitInt type instead of a string? https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt

mssql doesn't support Node versions < 10 according to changelog, and it's been around since 10.4

blitzmann avatar Apr 21 '22 20:04 blitzmann

Yep, definitely, but it's more about the underlying drivers than about this library. If they support either strings and/or BigInt, then we can use them.

dhensby avatar Apr 21 '22 22:04 dhensby

Ah that makes sense

blitzmann avatar Apr 22 '22 00:04 blitzmann

Well, interestingly, the tedious driver does not allow strings to be used for bigints and instead they must be set to varchars...

So this is the problem we have getting this merged, the tedious driver is the blocker

dhensby avatar Sep 04 '23 22:09 dhensby