Skip to main content

ubiquisync_sql/
lib.rs

1//! Protocol-agnostic SQL primitives for Ubiquisync.
2//!
3//! > **⚠ PRE-ALPHA — WORK IN PROGRESS ⚠**
4//! >
5//! > This crate is in active, early development. APIs are incomplete, unproven,
6//! > and **will change without notice**. Do not use it in production. Breaking
7//! > changes may land on any commit.
8//!
9//! The sync engine is storage-agnostic: it builds SQL as strings and runs them
10//! through a backend connection. This crate holds the pieces of that story that
11//! know nothing about any particular data domain:
12//!
13//! - [`db`] — the backend abstraction ([`Db`](db::Db)/[`DbBatch`](db::DbBatch)),
14//!   the value/row types, and the generic [`DbType`](db::DbType) storage class.
15//! - [`dialect`] — the closed [`SqlDialect`](dialect::SqlDialect) enum capturing
16//!   the points where SQL flavors diverge.
17//! - [`hlc_storage`] — a SQL-backed implementation of the core HLC storage.
18//!
19//! Data domains such as the table protocol (`ubiquisync-tables`) build on top
20//! of these; concrete drivers (`ubiquisync-sqlite`, `ubiquisync-postgres`)
21//! implement [`Db`](db::Db) and report which [`SqlDialect`](dialect::SqlDialect)
22//! they speak.
23
24pub mod db;
25pub mod dialect;
26pub mod hlc_storage;
27pub mod processor;
28pub mod reducer;
29pub mod store;
30pub mod tracker;
31pub mod util;
32
33/// Backend-agnostic test suites the driver crates run against their real `Db`.
34/// Compiled for this crate's own tests, and for any crate that enables the
35/// `test-support` feature (a SQL driver, in its dev-dependencies).
36#[cfg(any(test, feature = "test-support"))]
37pub mod test_support;