drizzle-team / drizzle-team/drizzle-orm
[DOCS]: recommend use of supportBigNumbers and bigNumberStrings with bigint and decimal when using mysql2
- Dominant language
- TypeScript
- Stars
- 35.8k
- Forks
- 1.6k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 4
Description
### Enhancement hasn't been filed before.
- [x] I have verified this enhancement I'm about to request hasn't been suggested before.
### Describe the enhancement you want to request
My testing with drizzle-orm@0.38.4 and mysql2@3.12.0 indicates that there is precision loss for values returned from queries without *both*. `supportBigNumbers` and `bigNumberStrings` turned on.
It's unclear to me why turning on only supportBigNumbers doesn't work - this may be a bug with drizzle-orm converting the value to a number at some point.
https://github.com/drizzle-team/drizzle-orm/issues/1632#issue-2035681597
Basically, the fix described here didn't work for me without also including `bigNumberStrings: true`.
In any case though, supportBigNumbers and bigNumberStrings should be prominently mentioned in the blurbs for both `bigint` and `decimal`, and in the getting-started section for mysql so others can avoid the headache I went through finding this bug in prod.
Contributor guide
Assessment
This issue has not been assessed yet.