Closed NathanX-S closed 3 years ago
This will unfortunately break a lot of code, perhaps there should be a bool argument (or more extendable, a table of settings) in the query method to alter this behaviour.
That works too, just losing tons of data for no good reason is a pain in the neck. Even if it's in _mysqloolib, fine by me.
Cast the bigint to a string in your select statement, then you can get it as a string, which retains the precision.
I'd rather have this as a built in feature, as @Kefta proposed.
I don't see how it is hard to simply add a cast to string? Adding a bool parameter to every function that queries the database would be a very big change (that complicates the api a lot because optional parameters in lua are bad) for as far as I can see no gain at all.
https://github.com/tediousjs/node-mssql/issues/187 https://i.imgur.com/LFKhZ91.png This behaviour is at the very least supported across other modules and is to be expected to have. Maybe a configuration outside of the query?
Fredy is right, the simple solution is just to cast. Numbers should always have been returned as strings but changing it now would break a ton of code.
LUA can't handle these numbers and instead precision is lost and the data becomes useless upon being passed through the module, can this be changed to return them as strings instead?