commit 89b28cff0055c0bd7e92a021d077edff9214db38
parent da9525d37943bb014084885d3259de473e79e7f3
Author: triesap <tyson@radroots.org>
Date: Wed, 15 Jul 2026 05:26:51 +0000
sdk: align SQLx runtime error handling
- Map the new geocoder SQLite connection-lock failure into the SDK cache error kind.
- Move replica ingest tests onto the SQLx SQLite executor exported by sql_core.
- Drop stale rusqlite lockfile packages from the SDK dependency graph.
- Keep runtime feature imports warning-clean across default, runtime, and local-runtime checks.
Diffstat:
5 files changed, 14 insertions(+), 54 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
@@ -617,18 +617,6 @@ dependencies = [
]
[[package]]
-name = "fallible-iterator"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649"
-
-[[package]]
-name = "fallible-streaming-iterator"
-version = "0.1.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a"
-
-[[package]]
name = "fastrand"
version = "2.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1859,12 +1847,13 @@ dependencies = [
name = "radroots_geocoder"
version = "0.1.0-alpha.2"
dependencies = [
+ "futures-executor",
"hex",
"radroots_runtime_paths",
"reqwest",
- "rusqlite",
"serde",
"sha2",
+ "sqlx",
"tempfile",
"thiserror 1.0.69",
"url",
@@ -2181,9 +2170,10 @@ name = "radroots_sql_core"
version = "0.1.0-alpha.2"
dependencies = [
"chrono",
- "rusqlite",
+ "futures-executor",
"serde",
"serde_json",
+ "sqlx",
"uuid",
]
@@ -2409,30 +2399,6 @@ dependencies = [
]
[[package]]
-name = "rsqlite-vfs"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c51c9ae4df8a7fba42103df5c621fa3c37eccf3a3c650879e90fc48b11cc192c"
-dependencies = [
- "hashbrown 0.16.1",
- "thiserror 2.0.18",
-]
-
-[[package]]
-name = "rusqlite"
-version = "0.39.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a0d2b0146dd9661bf67bb107c0bb2a55064d556eeb3fc314151b957f313bcd4e"
-dependencies = [
- "bitflags",
- "fallible-iterator",
- "fallible-streaming-iterator",
- "libsqlite3-sys",
- "smallvec",
- "sqlite-wasm-rs",
-]
-
-[[package]]
name = "rust-ini"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2752,18 +2718,6 @@ dependencies = [
]
[[package]]
-name = "sqlite-wasm-rs"
-version = "0.5.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dc3efc0da82635d7e1ced0053bbbfa8c7ab9645d0bf36ceb4f7127bb85315d75"
-dependencies = [
- "cc",
- "js-sys",
- "rsqlite-vfs",
- "wasm-bindgen",
-]
-
-[[package]]
name = "sqlx"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/crates/sdk/src/error.rs b/crates/sdk/src/error.rs
@@ -793,6 +793,7 @@ impl From<radroots_geocoder::GeocoderError> for RadrootsSdkError {
}
radroots_geocoder::GeocoderError::Io(_)
| radroots_geocoder::GeocoderError::Sqlite(_)
+ | radroots_geocoder::GeocoderError::SqliteConnectionLockUnavailable
| radroots_geocoder::GeocoderError::AssetLockUnavailable { .. } => {
RadrootsSdkGeoNamesErrorKind::Cache
}
diff --git a/crates/sdk/src/orders_runtime.rs b/crates/sdk/src/orders_runtime.rs
@@ -25,6 +25,7 @@ use crate::{
use radroots_authority::RadrootsActorContext;
#[cfg(all(feature = "runtime", test))]
use radroots_authority::RadrootsEventSigner;
+#[cfg(any(feature = "signer-adapters", test))]
use radroots_event::wire::RadrootsNip01EventWireParts;
#[cfg(feature = "runtime")]
use radroots_event::{
diff --git a/crates/sdk/tests/replica_ingest.rs b/crates/sdk/tests/replica_ingest.rs
@@ -2,7 +2,7 @@ use radroots_event::{RadrootsEventEnvelope, RadrootsEventEnvelopeParts, farm::Ra
use radroots_replica_schema::farm::IFarmFindMany;
use radroots_replica_store::ReplicaSql;
use radroots_replica_sync::{RadrootsReplicaIngestOutcome, radroots_replica_ingest_event};
-use radroots_sql_core::{SqlExecutor, SqliteExecutor};
+use radroots_sql_core::{SqlExecutor, SqlxSqliteExecutor};
use tempfile::{TempDir, tempdir};
fn seller_pubkey() -> String {
@@ -42,10 +42,10 @@ fn sample_farm() -> RadrootsFarm {
}
}
-fn open_replica() -> (TempDir, ReplicaSql<SqliteExecutor>) {
+fn open_replica() -> (TempDir, ReplicaSql<SqlxSqliteExecutor>) {
let dir = tempdir().expect("tempdir");
let db_path = dir.path().join("replica.sqlite");
- let executor = SqliteExecutor::open(&db_path).expect("open sqlite");
+ let executor = SqlxSqliteExecutor::open(&db_path).expect("open sqlite");
executor
.exec("PRAGMA foreign_keys = ON;", "[]")
.expect("enable foreign keys");
@@ -54,7 +54,7 @@ fn open_replica() -> (TempDir, ReplicaSql<SqliteExecutor>) {
(dir, replica)
}
-fn ingest_farm(replica: &ReplicaSql<SqliteExecutor>) -> RadrootsEventEnvelope {
+fn ingest_farm(replica: &ReplicaSql<SqlxSqliteExecutor>) -> RadrootsEventEnvelope {
let farm_value = sample_farm();
let author = seller_pubkey();
let parts = radroots_event_codec::farm::encode::to_wire_parts(&farm_value).expect("farm draft");
diff --git a/crates/sdk/tests/unit/error_tests.rs b/crates/sdk/tests/unit/error_tests.rs
@@ -525,6 +525,10 @@ fn geonames_error_conversion_maps_source_errors_to_sdk_kinds() {
RadrootsSdkGeoNamesErrorKind::Cache,
),
(
+ GeocoderError::SqliteConnectionLockUnavailable,
+ RadrootsSdkGeoNamesErrorKind::Cache,
+ ),
+ (
GeocoderError::Io(std::io::Error::new(std::io::ErrorKind::NotFound, "missing")),
RadrootsSdkGeoNamesErrorKind::Cache,
),