-
Notifications
You must be signed in to change notification settings - Fork 470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
treat bigint as string in msnodesqlv8 driver #1387
base: master
Are you sure you want to change the base?
Conversation
1fb3a94
to
9f21a3e
Compare
Well, interestingly, the tedious driver does not allow strings to be used for bigints and instead they must be set to varchars... |
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
|
Yep, definitely, but it's more about the underlying drivers than about this library. If they support either strings and/or |
Ah that makes sense |
a7527cd
to
5c27016
Compare
5c27016
to
e5b3f60
Compare
e5b3f60
to
bd791d4
Compare
So this is the problem we have getting this merged, the tedious driver is the blocker |
BigInt types will lose precision if they are above the MAX_SAFE_INTEGER value. A work around for this is to use strings to represent the numbers instead.
bd791d4
to
a8723fb
Compare
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) |
What this does:
BigInts should be treated as strings to ensure no precision loss
Related issues:
Attempt to fix #1385
Pre/Post merge checklist: