Skip to main content

Crate ubiquisync_sql

Crate ubiquisync_sql 

Source
Expand description

Protocol-agnostic SQL primitives for Ubiquisync.

⚠ PRE-ALPHA — WORK IN PROGRESS ⚠

This crate is in active, early development. APIs are incomplete, unproven, and will change without notice. Do not use it in production. Breaking changes may land on any commit.

The sync engine is storage-agnostic: it builds SQL as strings and runs them through a backend connection. This crate holds the pieces of that story that know nothing about any particular data domain:

  • db — the backend abstraction (Db/DbBatch), the value/row types, and the generic DbType storage class.
  • dialect — the closed SqlDialect enum capturing the points where SQL flavors diverge.
  • hlc_storage — a SQL-backed implementation of the core HLC storage.

Data domains such as the table protocol (ubiquisync-tables) build on top of these; concrete drivers (ubiquisync-sqlite, ubiquisync-postgres) implement Db and report which SqlDialect they speak.

Modules§

db
The SQL backend abstraction: values, rows, batches, and the Db trait.
dialect
SQL dialect: the points where SQL flavors genuinely diverge.
hlc_storage
SQL-backed HlcStorage for the hybrid logical clock.
processor
The ingestion driver: applies one log entry atomically, and exposes the stored log back as a Replica.
reducer
Op → SQL translation: the Reducer trait a data domain implements to turn each of its ops into the backend writes that materialize it.
store
SQL-backed Store adding ad-hoc read queries.
tracker
Recording the log entries a processor ingests.
util
Small SQL string helpers shared across backends.