From 115c976c92792a983d59dab44891dae423658214 Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Fri, 22 Mar 2024 17:04:16 -0400 Subject: [PATCH] Update sqlite-hashes dependency (#1268) Minor internal breaking changes --- Cargo.lock | 12 ++++++------ Cargo.toml | 3 ++- mbtiles/src/mbtiles.rs | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cee1587fe..287099b02 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -437,9 +437,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "95d8e92cac0961e91dbd517496b00f7e9b92363dbe6d42c3198268323798860c" dependencies = [ "addr2line", "cc", @@ -606,9 +606,9 @@ checksum = "7b02b629252fe8ef6460461409564e2c21d0c8e77e0944f3d189ff06c4e932ad" [[package]] name = "cargo-platform" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "694c8807f2ae16faecc43dc17d74b3eb042482789fd0eb64b39a2e04e087053f" +checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" dependencies = [ "serde", ] @@ -3766,9 +3766,9 @@ dependencies = [ [[package]] name = "sqlite-hashes" -version = "0.6.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "832470995a0edea4cfc1524c02060e1e1fcbe3230f2bc7be7e8eaa5ad60cfec5" +checksum = "b4faff0b1f487d94938f61fe78989b8e1e9524cf16a0b63174129c6a427057e2" dependencies = [ "digest", "hex", diff --git a/Cargo.toml b/Cargo.toml index eb672a33f..bee3e2b90 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,6 +48,7 @@ insta = "1" itertools = "0.12" json-patch = "1.2" lambda-web = { version = "0.2.1", features = ["actix4"] } +libsqlite3-sys = { version = ">=0.27", features = ["bundled"] } log = "0.4" martin-tile-utils = { path = "./martin-tile-utils", version = "0.4.0" } mbtiles = { path = "./mbtiles", version = "0.9.0" } @@ -72,7 +73,7 @@ serde_with = "3" serde_yaml = "0.9" size_format = "1.0.2" spreet = { version = "0.11", default-features = false } -sqlite-hashes = { version = "0.6", default-features = false, features = ["md5", "window", "hex"] } # window forces libsqlite3-sys to bundle sqlite3. We require v3.44.0 or newer. +sqlite-hashes = { version = "0.7.1", default-features = false, features = ["md5", "aggregate", "hex"] } sqlx = { version = "0.7", features = ["sqlite", "runtime-tokio"] } subst = { version = "0.3", features = ["yaml"] } thiserror = "1" diff --git a/mbtiles/src/mbtiles.rs b/mbtiles/src/mbtiles.rs index fe62c7e6b..9808fb194 100644 --- a/mbtiles/src/mbtiles.rs +++ b/mbtiles/src/mbtiles.rs @@ -5,7 +5,7 @@ use std::path::Path; use enum_display::EnumDisplay; use log::debug; use serde::{Deserialize, Serialize}; -use sqlite_hashes::register_md5_function; +use sqlite_hashes::register_md5_functions; use sqlx::sqlite::SqliteConnectOptions; use sqlx::{query, Connection as _, Executor, SqliteConnection, SqliteExecutor, Statement}; @@ -225,7 +225,7 @@ pub async fn attach_hash_fn(conn: &mut SqliteConnection) -> MbtResult<()> { // Safety: we know that the handle is a SQLite connection is locked and is not used anywhere else. // The registered functions will be dropped when SQLX drops DB connection. let rc = unsafe { sqlite_hashes::rusqlite::Connection::from_handle(handle) }?; - register_md5_function(&rc)?; + register_md5_functions(&rc)?; Ok(()) }