Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySQL Support BigDecimal originally #2051

Closed
BigtoC opened this issue Oct 16, 2020 · 3 comments · Fixed by #3058
Closed

MySQL Support BigDecimal originally #2051

BigtoC opened this issue Oct 16, 2020 · 3 comments · Fixed by #3058
Labels
Milestone

Comments

@BigtoC
Copy link

BigtoC commented Oct 16, 2020

I am working on a project that required read/write BigDecimal data, like 12345.123456789123456789.
But while I'm using SQLDelight, it rounds my number to 12345.1234568, my numbers lost precisions.
Even I implemented ColumnAdapter, it just converts the data from db to double, then convert to BigDecimal, still losing precisions.

Hope will fix in the future release🙏 Thanks!

@BigtoC BigtoC added the feature label Oct 16, 2020
@angusholder
Copy link
Contributor

Which underlying database are you using? (SQLite/MySQL/Postgres/..)

If SQLite, it has no support for arbitrary precision numbers and there's nothing SQLDelight can change about that, so your only option is to store the BigDecimal as a string

@BigtoC
Copy link
Author

BigtoC commented Oct 16, 2020

Which underlying database are you using? (SQLite/MySQL/Postgres/..)

If SQLite, it has no support for arbitrary precision numbers and there's nothing SQLDelight can change about that, so your only option is to store the BigDecimal as a string

I am using MySQL 5.7

@AlecKazakova
Copy link
Collaborator

related: #1882

@BigtoC BigtoC changed the title Support BigDecimal originally MySQL Support BigDecimal originally Oct 18, 2020
@AlecKazakova AlecKazakova added this to the 2.0 milestone Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants