commit c489bb75228ae1ffd4ae5f9a5c6c404b038a1af4
parent c7b1b2a2515871154a790a42b0aad0a49870e655
Author: triesap <tyson@radroots.org>
Date: Sun, 12 Apr 2026 23:58:03 +0000
replica_db: reconcile staged workspace fallout
Diffstat:
3 files changed, 19 insertions(+), 10 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
@@ -2651,6 +2651,10 @@ dependencies = [
"radroots_nostr",
"radroots_nostr_connect",
"radroots_nostr_signer",
+ "radroots_replica_db",
+ "radroots_replica_db_schema",
+ "radroots_replica_sync",
+ "radroots_sql_core",
"radroots_trade",
"tempfile",
"tokio",
diff --git a/crates/replica_db/src/lib.rs b/crates/replica_db/src/lib.rs
@@ -124,7 +124,7 @@ pub mod query;
pub use backup::{DatabaseBackup, MigrationBackup, SchemaEntry};
#[cfg(not(feature = "coverage-minimal"))]
pub use export::{
- export_manifest, ReplicaDbExportManifestRs, TableCount, REPLICA_DB_EXPORT_VERSION,
+ REPLICA_DB_EXPORT_VERSION, ReplicaDbExportManifestRs, TableCount, export_manifest,
};
#[cfg(not(feature = "coverage-minimal"))]
pub use models::*;
@@ -137,11 +137,7 @@ pub struct ReplicaSql<E: SqlExecutor> {
impl<E: SqlExecutor> ReplicaSql<E> {
pub fn coverage_branch_probe(enabled: bool) -> &'static str {
- if enabled {
- "enabled"
- } else {
- "disabled"
- }
+ if enabled { "enabled" } else { "disabled" }
}
}
diff --git a/crates/replica_db/tests/full_mode.rs b/crates/replica_db/tests/full_mode.rs
@@ -114,7 +114,10 @@ fn full_mode_shaped_query_helpers_cover_cli_reads() {
"polygon": "POLYGON((18.06 59.33,18.07 59.33,18.07 59.34,18.06 59.34,18.06 59.33))",
"label": "stockholm"
}));
- let gcs_created = db.gcs_location_create(&gcs_location).expect("gcs create").result;
+ let gcs_created = db
+ .gcs_location_create(&gcs_location)
+ .expect("gcs create")
+ .result;
let trade_product: ITradeProductCreate = parse_json(json!({
"key": "product-a",
@@ -166,18 +169,24 @@ fn full_mode_shaped_query_helpers_cover_cli_reads() {
assert_eq!(rows[0].key, "product-a");
assert_eq!(rows[0].location_primary.as_deref(), Some("stockholm"));
- let lookup_rows = db.trade_product_lookup("product-a").expect("trade product lookup");
+ let lookup_rows = db
+ .trade_product_lookup("product-a")
+ .expect("trade product lookup");
assert_eq!(lookup_rows.len(), 1);
assert_eq!(lookup_rows[0].id, trade_product_created.id);
- assert_eq!(db.trade_product_search(&[]).expect("empty search"), Vec::new());
+ assert_eq!(
+ db.trade_product_search(&[]).expect("empty search"),
+ Vec::new()
+ );
assert_eq!(
db.farm_unique_d_tag_by_pubkey(hex64('a').as_str())
.expect("farm unique d tag"),
Some("farm-a".to_owned())
);
assert_eq!(
- db.nostr_event_last_created_at().expect("nostr event freshness"),
+ db.nostr_event_last_created_at()
+ .expect("nostr event freshness"),
Some(42)
);
}