What does MySQL bigint config mode do?

In a mysql schema, when creating a bigint, it wants a config object with a mode key where mode could be number. What does this do?
5 Replies
Dan
Dan2y ago
It's a bug, will fix shortly There are two modes for bigint columns bigint and number, depending on what you need to operate on in your code Even though autocomplete only shows number, you can use bigint and it will work correctly. It's an issue with the autocomplete only.
kelbs
kelbs2y ago
So I should set it to bigint always? I'm more asking what happens if I change the config mode? What does it control?
Dan
Dan2y ago
It controls whether you'll have to operate on number values or on BigInt values. Set it depending on what you need. Numbers in JS only support values up to 2^53, and BigInt supports up to 2^64. So if you don't need values higher than 2^53, it's more convenient to use the number mode.
kelbs
kelbs2y ago
Gotcha, thanks!
Dan
Dan2y ago
@kelbs btw, the types should now be fixed in drizzle-orm@beta, the autocomplete should correctly contain both bigint and number options.
Want results from more Discord servers?
Add your server