diff --git a/lib/sqlsync/examples/end-to-end-local-net.rs b/lib/sqlsync/examples/end-to-end-local-net.rs index 00f5598..957d707 100644 --- a/lib/sqlsync/examples/end-to-end-local-net.rs +++ b/lib/sqlsync/examples/end-to-end-local-net.rs @@ -80,7 +80,7 @@ fn start_server<'a>( let coordinator = CoordinatorDocument::open( storage_journal, MemoryJournalFactory, - &wasm_bytes[..], + WasmReducer::new(wasm_bytes.as_slice())?, )?; let coordinator = Arc::new(Mutex::new(coordinator)); @@ -112,7 +112,7 @@ fn start_server<'a>( } fn handle_client( - doc: Arc>>, + doc: Arc>>, socket: TcpStream, ) -> anyhow::Result<()> { log::info!("server: received client connection"); diff --git a/lib/sqlsync/src/coordinator.rs b/lib/sqlsync/src/coordinator.rs index 50e1862..1f444ee 100644 --- a/lib/sqlsync/src/coordinator.rs +++ b/lib/sqlsync/src/coordinator.rs @@ -8,7 +8,7 @@ use rusqlite::Transaction; use crate::db::{open_with_vfs, run_in_tx, ConnectionPair}; use crate::error::Result; -use crate::reducer::{Reducer, WasmReducer}; +use crate::reducer::Reducer; use crate::replication::{ ReplicationDestination, ReplicationError, ReplicationSource, }; @@ -47,7 +47,7 @@ impl CoordinatorDocument { pub fn open( storage: J, timeline_factory: J::Factory, - reducer: R, // reducer_wasm_bytes: &[u8], + reducer: R, ) -> Result { let (mut sqlite, mut storage) = open_with_vfs(storage)?; @@ -141,7 +141,7 @@ impl CoordinatorDocument { } /// CoordinatorDocument knows how to replicate it's storage journal -impl ReplicationSource +impl ReplicationSource for CoordinatorDocument { type Reader<'a> = ::Reader<'a> diff --git a/lib/sqlsync/src/timeline.rs b/lib/sqlsync/src/timeline.rs index 1da5035..8cdf669 100644 --- a/lib/sqlsync/src/timeline.rs +++ b/lib/sqlsync/src/timeline.rs @@ -9,7 +9,6 @@ use crate::{ lsn::{Lsn, LsnRange}, positioned_io::PositionedReader, reducer::{Reducer, ReducerError, WasmReducer}, - JournalError, }; const TIMELINES_TABLE_SQL: &str = "