logoalt Hacker News

Fabricio20today at 2:39 AM2 repliesview on HN

> bigints are smaller and faster, with less footguns

But be careful!! Javascript WILL interpret your bigints as Number() and round them down because they are too big without telling you!!!

Famously seen by every snowflake user that has interacted with Javascript, quite an annoying problem.


Replies

spiffytechtoday at 2:52 AM

Fortunately we're seeing more JS DB libraries offering to read large numbers as the BigInt type.

show 1 reply
paulddrapertoday at 3:10 AM

!!

Node.js drivers will correctly read int64 as string or bigint, not number.

E.g. pg for PostgreSQL

Maybe there’s a buggy driver but I don’t know it.