Skip to content

Commit c1bd9dc

Browse files
authored
Bump jsonb 0.5.0 (#82)
* bump jsonb 0.5.0 * fix
1 parent b5f7e8c commit c1bd9dc

File tree

3 files changed

+31
-19
lines changed

3 files changed

+31
-19
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
## [v0.5.0] - 2025-04-15
2+
3+
### Added
4+
5+
- Feat: json path support recursive wildcard member accessor `.**` syntax (#81)
6+
- Refactor: get object value by key name improve performance (#79)
7+
- Refactor: Implements serde trait for RawJsonb (#77)
8+
- Refactor JSONB functions: Improved API, Documentation, and Data Structures (#75)
9+
- Feat: add arithmatic expression support (#71)
10+
- Feat(expr): add filter expr `starts with` (#52)
11+
112
## [v0.4.4] - 2024-11-16
213

314
### Fixed
@@ -114,6 +125,7 @@
114125
- Implement `JSONB` encodes and decodes.
115126
- Implemented a number of `JSONB` functions.
116127

128+
[v0.5.0]: https://github.com/databendlabs/jsonb/compare/v0.4.4...v0.5.0
117129
[v0.4.4]: https://github.com/databendlabs/jsonb/compare/v0.4.3...v0.4.4
118130
[v0.4.3]: https://github.com/databendlabs/jsonb/compare/v0.4.2...v0.4.3
119131
[v0.4.2]: https://github.com/databendlabs/jsonb/compare/v0.4.1...v0.4.2

Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ keywords = ["json", "jsonb", "jsonpath"]
2222
license = "Apache-2.0"
2323
name = "jsonb"
2424
repository = "https://github.com/databendlabs/jsonb"
25-
version = "0.4.4"
26-
rust-version = "1.77"
25+
version = "0.5.0"
26+
rust-version = "1.80"
2727

2828
[dependencies]
2929
byteorder = "1.5.0"
@@ -32,16 +32,16 @@ itoa = "1.0"
3232
nom = "7.1.3"
3333
num-traits = "0.2.19"
3434
ordered-float = { version = "5.0", default-features = false }
35-
rand = { version = "0.8.5", features = ["small_rng"] }
35+
rand = { version = "0.9.0", features = ["small_rng"] }
3636
ryu = "1.0"
3737
serde = "1.0"
3838
serde_json = { version = "1.0", default-features = false, features = ["std"] }
3939

4040
[dev-dependencies]
41-
goldenfile = "1.7"
41+
goldenfile = "1.8"
4242
serde_json = "1.0"
4343
json-deserializer = "0.4.4"
44-
simd-json = "0.13.10"
44+
simd-json = "0.15.0"
4545
mockalloc = "0.1.2"
4646
criterion = "0.5.1"
4747

src/value.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ use std::fmt::Display;
1919
use std::fmt::Formatter;
2020
use std::mem::discriminant;
2121

22-
use rand::distributions::Alphanumeric;
23-
use rand::distributions::DistString;
24-
use rand::thread_rng;
22+
use rand::distr::Alphanumeric;
23+
use rand::distr::SampleString;
24+
use rand::rng;
2525
use rand::Rng;
2626

2727
use super::number::Number;
@@ -269,18 +269,18 @@ impl<'a> Value<'a> {
269269

270270
/// generate random JSONB value
271271
pub fn rand_value() -> Value<'static> {
272-
let mut rng = thread_rng();
273-
let val = match rng.gen_range(0..=2) {
272+
let mut rng = rng();
273+
let val = match rng.random_range(0..=2) {
274274
0 => {
275-
let len = rng.gen_range(0..=5);
275+
let len = rng.random_range(0..=5);
276276
let mut values = Vec::with_capacity(len);
277277
for _ in 0..len {
278278
values.push(Self::rand_scalar_value());
279279
}
280280
Value::Array(values)
281281
}
282282
1 => {
283-
let len = rng.gen_range(0..=5);
283+
let len = rng.random_range(0..=5);
284284
let mut obj = Object::new();
285285
for _ in 0..len {
286286
let k = Alphanumeric.sample_string(&mut rng, 5);
@@ -295,27 +295,27 @@ impl<'a> Value<'a> {
295295
}
296296

297297
fn rand_scalar_value() -> Value<'static> {
298-
let mut rng = thread_rng();
299-
let val = match rng.gen_range(0..=3) {
298+
let mut rng = rng();
299+
let val = match rng.random_range(0..=3) {
300300
0 => {
301-
let v = rng.gen_bool(0.5);
301+
let v = rng.random_bool(0.5);
302302
Value::Bool(v)
303303
}
304304
1 => {
305305
let s = Alphanumeric.sample_string(&mut rng, 5);
306306
Value::String(Cow::from(s))
307307
}
308-
2 => match rng.gen_range(0..=2) {
308+
2 => match rng.random_range(0..=2) {
309309
0 => {
310-
let n: u64 = rng.gen_range(0..=100000);
310+
let n: u64 = rng.random_range(0..=100000);
311311
Value::Number(Number::UInt64(n))
312312
}
313313
1 => {
314-
let n: i64 = rng.gen_range(-100000..=100000);
314+
let n: i64 = rng.random_range(-100000..=100000);
315315
Value::Number(Number::Int64(n))
316316
}
317317
_ => {
318-
let n: f64 = rng.gen_range(-4000.0..1.3e5);
318+
let n: f64 = rng.random_range(-4000.0..1.3e5);
319319
Value::Number(Number::Float64(n))
320320
}
321321
},

0 commit comments

Comments
 (0)