-
Notifications
You must be signed in to change notification settings - Fork 134
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
RUST-36 Support of Decimal128 type #53
Comments
Thoughts? @kyeah |
nice, just one comment; looks great otherwise. |
I believe crates.io doesn't let you publish a crate that has both git and crates.io dependencies. Is there any chance that the author of the decimal crate might accept a PR? EDIT: Oops, that was the "one comment"; never mind! |
I have already submitted a PR to alkis/decimal#23 . I will remove that git dep after this PR is accepted. |
I see there is a commit with decimal128 support already. Are you still thinking of merging that commit in? Would love to see that happen! |
Don't know if it is the best way to support decimal 128 in Rust, yet. Rust is now supported |
@zonyitoo by it's possible core will support |
Yes, I agree. I would take sometime to make this commit works with the master. |
@zonyitoo if you feel like it's more work than you have capacity for, I can also help out! I just didn't want to step on your toes, since there was already a commit going. |
@lrlna That would be great! I don't have spear time in the recent future :( |
* [#53] supports decimal128 and add necessary documents * add documentation for decimal128 methods * add serialize + deserialize for decimal128 * add decimal128 tests + into_i32/_u32 methods
We can use https://jira.mongodb.org/browse/RUST-36 to track the work done for this issue |
I filed mongodb-rust/mongodb-schema-parser#35 before I saw this conversation. I am trying to parse a collection's schema using the schema parser. However because Checking mongodb v0.9.1
error[E0004]: non-exhaustive patterns: `&Decimal128(_)` not covered
--> C:\Users\me\.cargo\registry\src\github.com-1ecc6299db9ec823\mongodb-0.9.1\src\bson_util.rs:128:11
|
128 | match val {
| ^^^ pattern `&Decimal128(_)` not covered
|
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms This is with the below Cargo.toml [dependencies]
bson = { version = "0.14", features = ["decimal128"] }
mongodb = "0.9.1"
# this contains the patch to use bson 0.14 on the schema parser
mongodb-schema-parser = { git = "https://github.com/nevi-me/mongodb-schema-parser", branch = "update-bson" } I don't need decimal128 support, so I'll fork the |
I tried to read data from mongodb collection that uses decimal128 but it panics
Is there any workaround or it's simply not possible with rust's mongodb library? EDIT: I had to explicitly add this to
|
@bugproof This was a bug actually that has since been fixed in |
Any update? |
Just checking in to see if there has been any update on this? |
Could the MongoDB team provide feedback of where support for Decimal128 is at? This issue was originally raised in 2017 and with no recent updates. A could of key points:
|
Hi @dotjon0, our current plan is to start implementation of this ~1 month from now. |
@kmahar thank you so much for the update, its very appreciated. Great to hear Decimal128 implementation is commencing in only a few weeks! Absolute fantastic news! Will look forward and thank you for making the time to update us. |
@kmahar hello 👋 ! I think there might be some interest in rust's standard library to have rust support decimal 128 implementation natively. If you end up writing this implementation from scratch, would be super cool if you could contribute it back to rust itself :) There is already a |
hey @lrlna! 🙂 I think to start this type would likely only support converting back and forth between string <-> decimal128 byte representations, and in the future we may try to support conversion to/from other Rust numeric types. If there was a |
amazing, exactly what we need! Thanks so much @kmahar |
Sorry for the long delay here, just wanted to let people know that implementation of conversion to and from human-readable strings for the |
We just released version 2.6.0 of the bson crate, which includes support for conversion between Decimal128 values and human-readable strings 🙂 |
amazing @abr-egn thank you so much! |
According to BSON 1.1 Spec, it introduced a new type
decimal128
.But currently Rust doesn't support
d128
type natively.Related links
d128
crate: https://github.com/alkis/decimalThe text was updated successfully, but these errors were encountered: