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

Use different type to represent DECIMAL than rust_decimals::Decimal #204

Open
xoac opened this issue Mar 22, 2023 · 2 comments
Open

Use different type to represent DECIMAL than rust_decimals::Decimal #204

xoac opened this issue Mar 22, 2023 · 2 comments
Labels
dependencies Dependency versions, features and changes. feature New feature or request good first issue Good for newcomers

Comments

@xoac
Copy link

xoac commented Mar 22, 2023

Hi cornucopia team,
I have found another place where it's hard to work with cornucopia,. It's completely fine to insert 7777777777777777777777777777777777777777777777777777 into PostgreSQL DECIMAL column.

Unfortunately rust_decimal::Decimal::from_str('7777777777777777777777777777777777777777777777777777') will return error so using it to represent DECIMAL is limited.

On possible solution:

  1. add PR for bigdecimal crate to optionally enable support for postgresql?
  2. migrate from rust_decimal to bigdecimal for DECIMAL type
@LouisGariepy LouisGariepy added feature New feature or request good first issue Good for newcomers dependencies Dependency versions, features and changes. labels Mar 22, 2023
farazfazli added a commit to farazfazli/cornucopia that referenced this issue Mar 23, 2023
@LouisGariepy
Copy link
Member

Looking a bit more into this, it seems like bigdecimal has a number of concerning implementation issues.

The maintainer of rust_decimal has expressed interest in implementing arbitrary precision paupino/rust-decimal#562 (comment). This might be something we just have to wait for unless we can find another decent big decimal crate.

@LouisGariepy
Copy link
Member

See also this comment on why Borsch (a serialization format) didn't implement bigdecimal support near/borsh-rs#91 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Dependency versions, features and changes. feature New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants