graph, store: bump num-bigint
and bigdecimal
#2781
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR bumps
num-bigint
from^0.2.6
to^0.4.7
bigdecimal
from0.1.0
to0.3.0
This change has pros and cons, however.
Pros
BigDecimal::normalized
.bigdecimal
no longer implementsFrom<f64>
forBigDecimal
, which is something that could panic before.This means that the graph-node-defined
scalar::BigDecimal
struct now implementsTryFrom<f64>
instead ofFrom<f64>
Cons
num-bigint 0.2.6
andbigdecimal 0.1.0
.This means that we're no longer able to use the Diesel-defined
ToSql<diesel::sql_types::Numeric, _>
andFromSql<diesel::sql_types::Numeric, _> for BigDecimal
implementations for version 0.3.0 ofBigDecimal
until Diesel upgrades their dependencies.In order to maintain support for these traits, I implemented the BigDecimalRetrocompatibility struct, which has functions for converting to and from versions 0.1 and 0.3 of
BigDecimal
.API limitations make this operation make heap allocations, although I believe those allocations should be small most of the time.
@tilacog @lutter @otaviopace @leoyvens
If you guys believe that this PR is the way to go, I'll add tests for
BigDecimalRetrocompatibility
and further docs on things I changed