chore: upgrade rusqlite dependency to 0.38.0

This commit is contained in:
2026-01-12 14:25:18 +01:00
parent 3b3e495254
commit b59cb0fb56
17 changed files with 183 additions and 52 deletions

172
01.workspace/Cargo.lock generated
View File

@@ -8,6 +8,12 @@ version = "2.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3"
[[package]]
name = "bumpalo"
version = "3.19.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510"
[[package]]
name = "cc"
version = "1.2.45"
@@ -18,6 +24,12 @@ dependencies = [
"shlex",
]
[[package]]
name = "cfg-if"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
[[package]]
name = "fallible-iterator"
version = "0.3.0"
@@ -38,24 +50,24 @@ checksum = "52051878f80a721bb68ebfbc930e07b65ba72f2da88968ea5c06fd6ca3d3a127"
[[package]]
name = "foldhash"
version = "0.1.5"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2"
checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb"
[[package]]
name = "hashbrown"
version = "0.15.5"
version = "0.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1"
checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
dependencies = [
"foldhash",
]
[[package]]
name = "hashlink"
version = "0.10.0"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1"
checksum = "ea0b22561a9c04a7cb1a302c013e0259cd3b4bb619f145b32f72b8b4bcbed230"
dependencies = [
"hashbrown",
]
@@ -68,16 +80,32 @@ dependencies = [
]
[[package]]
name = "libsqlite3-sys"
version = "0.35.0"
name = "js-sys"
version = "0.3.83"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "133c182a6a2c87864fe97778797e46c7e999672690dc9fa3ee8e241aa4a9c13f"
checksum = "464a3709c7f55f1f721e5389aa6ea4e3bc6aba669353300af094b29ffbdde1d8"
dependencies = [
"once_cell",
"wasm-bindgen",
]
[[package]]
name = "libsqlite3-sys"
version = "0.36.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "95b4103cffefa72eb8428cb6b47d6627161e51c2739fc5e3b734584157bc642a"
dependencies = [
"cc",
"pkg-config",
"vcpkg",
]
[[package]]
name = "once_cell"
version = "1.21.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
[[package]]
name = "pkg-config"
version = "0.3.32"
@@ -85,10 +113,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c"
[[package]]
name = "rusqlite"
version = "0.37.0"
name = "proc-macro2"
version = "1.0.105"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "165ca6e57b20e1351573e3729b958bc62f0e48025386970b6e4d29e7a7e71f3f"
checksum = "535d180e0ecab6268a3e718bb9fd44db66bbbc256257165fc699dadf70d16fe7"
dependencies = [
"unicode-ident",
]
[[package]]
name = "quote"
version = "1.0.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc74d9a594b72ae6656596548f56f667211f8a97b3d4c3d467150794690dc40a"
dependencies = [
"proc-macro2",
]
[[package]]
name = "rusqlite"
version = "0.38.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1c93dd1c9683b438c392c492109cb702b8090b2bfc8fed6f6e4eb4523f17af3"
dependencies = [
"bitflags",
"fallible-iterator",
@@ -96,8 +142,15 @@ dependencies = [
"hashlink",
"libsqlite3-sys",
"smallvec",
"sqlite-wasm-rs",
]
[[package]]
name = "rustversion"
version = "1.0.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
[[package]]
name = "shlex"
version = "1.3.0"
@@ -110,8 +163,103 @@ version = "1.15.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"
[[package]]
name = "sqlite-wasm-rs"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05e98301bf8b0540c7de45ecd760539b9c62f5772aed172f08efba597c11cd5d"
dependencies = [
"cc",
"hashbrown",
"js-sys",
"thiserror",
"wasm-bindgen",
]
[[package]]
name = "syn"
version = "2.0.114"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "thiserror"
version = "2.0.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
version = "2.0.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "unicode-ident"
version = "1.0.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5"
[[package]]
name = "vcpkg"
version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
[[package]]
name = "wasm-bindgen"
version = "0.2.106"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d759f433fa64a2d763d1340820e46e111a7a5ab75f993d1852d70b03dbb80fd"
dependencies = [
"cfg-if",
"once_cell",
"rustversion",
"wasm-bindgen-macro",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-macro"
version = "0.2.106"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "48cb0d2638f8baedbc542ed444afc0644a29166f1595371af4fecf8ce1e7eeb3"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
]
[[package]]
name = "wasm-bindgen-macro-support"
version = "0.2.106"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cefb59d5cd5f92d9dcf80e4683949f15ca4b511f4ac0a6e14d4e1ac60c6ecd40"
dependencies = [
"bumpalo",
"proc-macro2",
"quote",
"syn",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-shared"
version = "0.2.106"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cbc538057e648b67f72a982e708d485b2efa771e1ac05fec311f9f63e5800db4"
dependencies = [
"unicode-ident",
]

View File

@@ -4,4 +4,4 @@ version = "0.1.0"
edition = "2024"
[dependencies]
rusqlite = { version = "0.37.0", features = ["bundled"] }
rusqlite = { version = "0.38.0", features = ["bundled"] }

View File

@@ -8,7 +8,7 @@ struct Component {
pub id: String,
pub part_number: String,
pub kind: String,
pub value: u64,
pub value: u32,
pub package: String,
pub in_stock: bool,
}

View File

@@ -8,21 +8,21 @@ use std::path::Path;
struct Laptop {
pub id: String,
pub model: String,
pub price: u64,
pub price: u32,
}
#[derive(PartialEq, Clone)]
struct Display {
pub id: String,
pub model: String,
pub resolution: f64,
pub price: u64,
pub price: u32,
}
#[derive(PartialEq, Clone)]
struct Mouse {
pub id: String,
pub model: String,
pub wireless: bool,
pub price: u64,
pub price: u32,
}
#[derive(PartialEq, Clone)]
enum Product {

View File

@@ -4,7 +4,7 @@ pub fn run(row: &rusqlite::Row) -> rusqlite::Result<Attribute> {
let id: String = row.get(0)?;
let _entity_id: String = row.get(1)?;
let signed_int: Option<i64> = row.get(2)?;
let unsigned_int: Option<u64> = row.get(3)?;
let unsigned_int: Option<u32> = row.get(3)?;
let real: Option<f64> = row.get(4)?;
let text: Option<String> = row.get(5)?;
let bool: Option<bool> = row.get(6)?;

View File

@@ -4,7 +4,7 @@ pub fn run(row: &rusqlite::Row) -> rusqlite::Result<Entity> {
let id: String = row.get(0)?;
let class: String = row.get(1)?;
let subclass: Option<String> = row.get(2)?;
let ref_date: Option<u64> = row.get(3)?;
let ref_date: Option<u32> = row.get(3)?;
let entity = Entity {
id,
state: EntityState::Loaded,

View File

@@ -22,7 +22,6 @@ pub mod i32_try_from_value;
pub mod i64_try_from_value;
pub mod string_try_from_value;
pub mod u32_try_from_value;
pub mod u64_try_from_value;
pub mod value_from_bool;
pub mod value_from_f64;
pub mod value_from_i32;
@@ -30,4 +29,3 @@ pub mod value_from_i64;
pub mod value_from_str;
pub mod value_from_string;
pub mod value_from_u32;
pub mod value_from_u64;

View File

@@ -4,7 +4,7 @@ impl TryFrom<Value> for u32 {
type Error = ();
fn try_from(value: Value) -> Result<u32, Self::Error> {
match value {
Value::UnsignedInt(value) => value.try_into().map_err(|_| ()),
Value::UnsignedInt(value) => Ok(value),
_ => Err(()),
}
}

View File

@@ -1,11 +0,0 @@
use crate::*;
impl TryFrom<Value> for u64 {
type Error = ();
fn try_from(value: Value) -> Result<u64, Self::Error> {
match value {
Value::UnsignedInt(value) => Ok(value),
_ => Err(()),
}
}
}

View File

@@ -1,7 +0,0 @@
use crate::*;
impl From<u64> for Value {
fn from(value: u64) -> Self {
Self::UnsignedInt(value)
}
}

View File

@@ -34,6 +34,9 @@
//!
//! ```rust,no_run
//! use heave::*;
//! use heave::eav::*;
//! use heave::catalog::*;
//! use heave::filter::*;
//! use std::convert::{From, TryFrom};
//! use std::result::Result;
//!
@@ -42,7 +45,7 @@
//! struct Product {
//! pub id: String,
//! pub name: String,
//! pub price: u64,
//! pub price: u32,
//! pub in_stock: bool,
//! }
//!

View File

@@ -10,7 +10,7 @@ pub struct O {
pub(crate) state: EntityState,
/// An optional timestamp or version number, typically used for optimistic
/// locking or tracking when the entity was last referenced or modified.
pub(crate) ref_date: Option<u64>,
pub(crate) ref_date: Option<u32>,
/// A string identifying the "type" or "class" of the entity (e.g., "product", "user").
/// This is used to group and query entities of the same kind.
pub(crate) class: String,
@@ -77,7 +77,7 @@ impl Entity {
/// # Returns
///
/// The entity with the updated reference date.
pub fn with_ref_date(mut self, ref_date: u64) -> Self {
pub fn with_ref_date(mut self, ref_date: u32) -> Self {
self.ref_date = Some(ref_date);
self
}

View File

@@ -5,9 +5,9 @@ use crate::*;
#[derive(Debug, Default, PartialEq, Clone)]
pub struct O {
pub id: String,
pub first_seen: u64,
pub first_seen: u32,
pub name: String,
pub price: u64,
pub price: u32,
pub discount: f64,
pub sell_trend: i64,
pub in_stock: bool,

View File

@@ -15,7 +15,7 @@ pub enum Value {
/// A UTF-8 encoded string.
Text(String),
/// An unsigned 64-bit integer.
UnsignedInt(u64),
UnsignedInt(u32),
}
impl std::fmt::Display for Value {

View File

@@ -34,7 +34,7 @@ mod tests {
.unwrap();
assert_eq!(entity1.state, EntityState::New);
assert_eq!(entity1.value_of("name"), Some(&Value::from("Item 1")));
assert_eq!(entity1.value_of("price"), Some(&Value::from(10u64)));
assert_eq!(entity1.value_of("price"), Some(&Value::from(10u32)));
assert_eq!(entity1.value_of("sell_trend"), Some(&Value::from(0i64)));
let entity2 = catalog
.with_items(|items| {
@@ -44,7 +44,7 @@ mod tests {
.unwrap();
assert_eq!(entity2.state, EntityState::New);
assert_eq!(entity2.value_of("name"), Some(&Value::from("Item 2")));
assert_eq!(entity2.value_of("price"), Some(&Value::from(20u64)));
assert_eq!(entity2.value_of("price"), Some(&Value::from(20u32)));
assert_eq!(entity2.value_of("sell_trend"), Some(&Value::from(0i64)));
}
}

View File

@@ -43,7 +43,7 @@ mod tests {
loaded_entity.value_of("name"),
Some(&Value::from("Test Item"))
);
assert_eq!(loaded_entity.value_of("price"), Some(&Value::from(123u64)));
assert_eq!(loaded_entity.value_of("price"), Some(&Value::from(123u32)));
assert_eq!(
loaded_entity.value_of("sell_trend"),
Some(&Value::from(0i64))
@@ -113,7 +113,7 @@ mod tests {
);
assert_eq!(
entity_after_load.value_of("price"),
Some(&Value::from(100u64))
Some(&Value::from(100u32))
);
assert_eq!(
entity_after_load.value_of("sell_trend"),

View File

@@ -22,7 +22,7 @@ mod tests {
assert_eq!(entity.state, EntityState::New);
assert_eq!(entity.class, "item");
assert_eq!(entity.value_of("name"), Some(&Value::from("Test Item")));
assert_eq!(entity.value_of("price"), Some(&Value::from(100u64)));
assert_eq!(entity.value_of("price"), Some(&Value::from(100u32)));
assert_eq!(entity.value_of("sell_trend"), Some(&Value::from(0i64)));
assert_eq!(entity.value_of("in_stock"), Some(&Value::from(true)));
}
@@ -54,7 +54,7 @@ mod tests {
.with_items(|items| Ok(items.get(&item_id).unwrap().clone()))
.unwrap();
assert_eq!(entity.value_of("name"), Some(&Value::from("Second Item")));
assert_eq!(entity.value_of("price"), Some(&Value::from(200u64)));
assert_eq!(entity.value_of("price"), Some(&Value::from(200u32)));
assert_eq!(entity.value_of("sell_trend"), Some(&Value::from(10i64)));
assert_eq!(entity.value_of("in_stock"), Some(&Value::from(false)));
assert_eq!(entity.state, EntityState::Updated);