lib

Core libraries for Radroots
git clone https://radroots.dev/git/lib.git
Log | Files | Refs | README

commit cebd246ea7b45b615200b47fb72a23a3821dfe96
parent 5b49fe455e9e87ba6e7ddac140a860e12b3e4a7d
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:
Mcrates/sdk/src/error.rs | 1+
Mcrates/sdk/src/orders_runtime.rs | 1+
Mcrates/sdk/tests/replica_ingest.rs | 8++++----
Mcrates/sdk/tests/unit/error_tests.rs | 4++++
4 files changed, 10 insertions(+), 4 deletions(-)

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, ),