dyedgreen / deno-sqlite

Deno SQLite module
https://deno.land/x/sqlite
MIT License
409 stars 36 forks source link

Use BigInteger for integers larger than MAX_SAFE_INTEGER JS constant #66

Closed danbulant closed 4 years ago

danbulant commented 4 years ago

Hello there. As the title suggest, BigInteger should be used in place where integers itself are too big, since JS will round them and loose precision (which is bad, since I'm saving IDs which cannot be rounded at all).

E: For selects, a workaround is using cast method (e.g. SELECT CAST(idas text) FROM users;)

dyedgreen commented 4 years ago

Thanks for raising the issue! I agree that this should be fixed. I'll look into how to best do this. (I imagine passing integers around would be done as strings, but I'll have a look at how to best organize this on the side of the binding layer.)