tediousjs / node-mssql

Microsoft SQL Server client for Node.js
https://tediousjs.github.io/node-mssql
MIT License
2.23k stars 468 forks source link

treat bigint as string in msnodesqlv8 driver #1387

Open dhensby opened 2 years ago

dhensby commented 2 years ago

What this does:

BigInts should be treated as strings to ensure no precision loss

Related issues:

Attempt to fix #1385

Pre/Post merge checklist:

dhensby commented 2 years ago

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

blitzmann commented 2 years ago

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

dhensby commented 2 years ago

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.

blitzmann commented 2 years ago

Ah that makes sense

dhensby commented 1 year ago

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 commented 4 months ago

So tedious introduced using native bigints for the bigint type in v18.2.0, which will be added in the next major release of this lib (imminent)