Server tools to backfill, tail, mirror, and verify PLC logs

use serde_json RawValue

+5 -4
+1 -1
Cargo.toml
··· 12 12 log = "0.4.28" 13 13 reqwest = "0.12.23" 14 14 serde = "1.0.219" 15 - serde_json = "1.0.143" 15 + serde_json = { version = "1.0.143", features = ["raw_value"] } 16 16 tokio = { version = "1.47.1", features = ["full"] } 17 17 tokio-postgres = { version = "0.7.13", features = ["with-chrono-0_4", "with-serde_json-1"] } 18 18 url = "2.5.7"
+4 -3
src/main.rs
··· 45 45 pub cid: &'a str, 46 46 pub created_at: chrono::DateTime<chrono::Utc>, 47 47 pub nullified: bool, 48 - pub operation: serde_json::Value, 48 + #[serde(borrow)] 49 + pub operation: &'a serde_json::value::RawValue, 49 50 } 50 51 51 52 async fn export_upstream( ··· 95 96 let op: OpPeek = serde_json::from_str(last_line).unwrap(); 96 97 after = Some(op.created_at); 97 98 98 - log::trace!("got {} ops until {after:?}, sending them...", ops.len()); 99 + log::trace!("got some ops until {after:?}, sending them..."); 99 100 tx.send_async(ExportPage { ops }).await.unwrap(); 100 101 } 101 102 } ··· 143 144 insert_op, 144 145 &[ 145 146 &op.did, 146 - &op.operation, 147 + &tokio_postgres::types::Json(op.operation), 147 148 &op.cid, 148 149 &op.nullified, 149 150 &op.created_at,