Skip to content

Commit 1c5788c

Browse files
committed
graph: Track diesel's bigdecimal version and drop vendored PG codec
Our `BigDecimal` wrapped `bigdecimal = 0.1.2` (renamed `old_bigdecimal`) to avoid diesel's numeric ToSql/FromSql impls targeting a distinct type, and to avoid a PoI divergence attributed to the upgrade. That forced `num-bigint` to `=0.2.6` and required ~150 lines of vendored PgNumeric codec. Move `bigdecimal` and `num-bigint` into `[workspace.dependencies]` (0.3 and 0.4, unpinned), so our newtype wraps the same type diesel ships impls for. The vendored `mod pg` collapses to two ToSql/FromSql delegations. The `big_decimal_stable` PoI hashes remain unchanged. `num-bigint` 0.4 returns `u64` from `BigInt::bits()` and requires a typed operand for `Shl`/`Shr`; adjust `BigInt` wrapper accordingly.
1 parent 6394545 commit 1c5788c

7 files changed

Lines changed: 69 additions & 419 deletions

File tree

Cargo.lock

Lines changed: 19 additions & 41 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ async-graphql = { version = "7.2.1", features = ["chrono"] }
4242
async-graphql-axum = "7.2.1"
4343
async-trait = "0.1.74"
4444
axum = "0.8.8"
45+
bigdecimal = { version = "0.3", features = ["serde"] }
4546
chrono = "0.4.44"
4647
bs58 = "0.5.1"
4748
clap = { version = "4.5.4", features = ["derive", "env", "wrap_help"] }
@@ -75,6 +76,7 @@ indicatif = "0.18"
7576
Inflector = "0.11.3"
7677
itertools = "0.14.0"
7778
lazy_static = "1.5.0"
79+
num-bigint = { version = "0.4", features = ["serde"] }
7880
prost = "0.14"
7981
prost-types = "0.14"
8082
redis = { version = "1.2.0", features = [

graph/Cargo.toml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,7 @@ anyhow = "1.0"
1010
async-trait = { workspace = true }
1111
async-stream = "0.3"
1212
atomic_refcell = "0.1.13"
13-
# We require this precise version of bigdecimal. Updating to later versions
14-
# has caused PoI differences; if you update this version, you will need to
15-
# make sure that it does not cause PoI changes
16-
old_bigdecimal = { version = "=0.1.2", features = [
17-
"serde",
18-
], package = "bigdecimal" }
13+
bigdecimal.workspace = true
1914
bytes = "1.0.1"
2015
bs58 = { workspace = true }
2116
cid = "0.11.1"
@@ -37,7 +32,7 @@ futures01 = { package = "futures", version = "0.1.31" }
3732
lru_time_cache = "0.11"
3833
graphql-tools = { workspace = true }
3934
lazy_static = { workspace = true }
40-
num-bigint = { version = "=0.2.6", features = ["serde"] }
35+
num-bigint.workspace = true
4136
num-integer = { version = "=0.1.46" }
4237
num-traits = "=0.2.19"
4338
rand.workspace = true

graph/src/data/query/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,8 +359,8 @@ impl From<FromHexError> for QueryExecutionError {
359359
}
360360
}
361361

362-
impl From<old_bigdecimal::ParseBigDecimalError> for QueryExecutionError {
363-
fn from(e: old_bigdecimal::ParseBigDecimalError) -> Self {
362+
impl From<bigdecimal::ParseBigDecimalError> for QueryExecutionError {
363+
fn from(e: bigdecimal::ParseBigDecimalError) -> Self {
364364
QueryExecutionError::ValueParseError("BigDecimal".to_string(), format!("{}", e))
365365
}
366366
}

0 commit comments

Comments
 (0)