//! Higher-level "syncable store" engine. //! //! `SyncStore` absorbs the SQLite plumbing every consuming app otherwise //! hand-writes, the changelog schema and triggers, push/pull loops, FK-ordered //! apply, HLC, blobs, and the scheduler, behind a declarative [`SyncSchema`]. //! An app declares its tables and per-table policy once; the engine owns the //! mechanics. See `docs/architecture.md` ("Proposed: the `SyncStore` helper"). //! //! Build status: **complete (B1–B7)**, schema types ([`schema`]), trigger/ //! migration generation ([`migrate`]), the DB seam + bookkeeping state ([`db`]), //! the FK-ordered apply engine ([`apply`]), the HLC ledger + conflict dispatch //! ([`hlc`]), the push/pull loops + lifecycle ([`sync`]), the blob engine //! ([`blob`]), and the [`SyncStore`](facade::SyncStore) facade + scheduler //! ([`facade`], [`scheduler`]). //! //! Start at [`SyncStore`](facade::SyncStore): declare a [`SyncSchema`](schema), //! build a store, and call `sync_now` or `spawn_scheduler`. pub mod apply; pub mod blob; #[cfg(feature = "store")] pub mod config; pub mod db; pub mod facade; pub mod hlc; pub mod migrate; pub mod scheduler; pub mod schema; pub mod sync; pub use apply::{ApplyOutcome, apply_remote_changes}; pub use blob::{ BlobOutcome, BlobPolicy, BlobRef, BlobTransport, download_blobs, download_one, sync_blobs, upload_blobs, }; pub use config::{config_sync_table, install_policy}; pub use db::{ DbSource, clear_applying_remote, device_id, get_scope_cursor, get_sync_state, get_sync_state_or, set_device_id, set_scope_cursor, set_sync_state, with_applying_remote, }; pub use facade::{SchedulerHandle, SyncConfig, SyncOutcome, SyncStore, SyncStoreBuilder}; pub use hlc::{ committed_hlc, load_clock, observe, record_committed, resolve_pull, set_committed, stamp_pending, }; pub use scheduler::{NoopObserver, SyncObserver, SyncState}; pub use schema::{ConflictStrategy, DeleteMode, RowIdScheme, SyncMode, SyncSchema, SyncTable}; pub use sync::{ PUSH_BATCH_LIMIT, PullOutcome, SyncScope, SyncTransport, cleanup_changelog, create_initial_snapshot, enforce_changelog_retention, ensure_device_registered, pull_changes, pull_scope, push_changes, push_scope, };