Skip to content

Commit 9309a97

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 9bbb1c4 commit 9309a97

7 files changed

Lines changed: 70 additions & 420 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
@@ -47,6 +47,7 @@ async-graphql = { version = "7.2.1", features = ["chrono"] }
4747
async-graphql-axum = "7.2.1"
4848
async-trait = "0.1.74"
4949
axum = "0.8.9"
50+
bigdecimal = { version = "0.3", features = ["serde"] }
5051
chrono = "0.4.44"
5152
bs58 = "0.5.1"
5253
clap = { version = "4.5.4", features = ["derive", "env", "wrap_help"] }
@@ -80,6 +81,7 @@ indicatif = "0.18"
8081
Inflector = "0.11.3"
8182
itertools = "0.14.0"
8283
lazy_static = "1.5.0"
84+
num-bigint = { version = "0.4", features = ["serde"] }
8385
prost = "0.14"
8486
prost-types = "0.14"
8587
redis = { version = "1.2.2", features = [

graph/Cargo.toml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,8 @@ base64 = "=0.21.7"
99
anyhow = "1.0"
1010
async-trait = { workspace = true }
1111
async-stream = "0.3"
12-
atomic_refcell = "0.1.14"
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" }
12+
atomic_refcell = "0.1.13"
13+
bigdecimal.workspace = true
1914
bytes = "1.0.1"
2015
bs58 = { workspace = true }
2116
cid = "0.11.3"
@@ -38,7 +33,7 @@ futures01 = { package = "futures", version = "0.1.31" }
3833
lru_time_cache = "0.11"
3934
graphql-tools = { workspace = true }
4035
lazy_static = { workspace = true }
41-
num-bigint = { version = "=0.2.6", features = ["serde"] }
36+
num-bigint.workspace = true
4237
num-integer = { version = "=0.1.46" }
4338
num-traits = "=0.2.19"
4439
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)