pub struct SqliteStore { /* private fields */ }Expand description
Immutable rows keyed by (doc_id, sid, time_start). Rows stay pending until
their actor prefix is contiguous and their dependencies are stored.
Implementations§
Source§impl SqliteStore
impl SqliteStore
Sourcepub fn open(path: impl AsRef<Path>) -> Result<Self>
pub fn open(path: impl AsRef<Path>) -> Result<Self>
Opens or creates a durable database file (WAL, synchronous FULL).
pub fn open_in_memory() -> Result<Self>
Sourcepub fn new(db: Connection) -> Result<Self>
pub fn new(db: Connection) -> Result<Self>
Installs the schema on an existing connection.
pub fn connection(&self) -> &Connection
Sourcepub fn append(&mut self, rows: &[PatchRow]) -> Result<AppendResult>
pub fn append(&mut self, rows: &[PatchRow]) -> Result<AppendResult>
Validates and stores rows of one document in one IMMEDIATE transaction. Exact retransmissions are ignored; a conflict rolls back the whole batch.
pub fn vector(&self, doc_id: &str) -> Result<VersionVector>
Sourcepub fn missing(
&self,
doc_id: &str,
remote: &VersionVector,
) -> Result<Vec<PatchRow>>
pub fn missing( &self, doc_id: &str, remote: &VersionVector, ) -> Result<Vec<PatchRow>>
Ready rows the peer lacks, ordered by actor and clock.
Sourcepub fn sync_state(
&mut self,
doc_id: &str,
remote: &VersionVector,
) -> Result<(Vec<PatchRow>, VersionVector)>
pub fn sync_state( &mut self, doc_id: &str, remote: &VersionVector, ) -> Result<(Vec<PatchRow>, VersionVector)>
missing and vector from one consistent snapshot.
Auto Trait Implementations§
impl !Freeze for SqliteStore
impl !RefUnwindSafe for SqliteStore
impl !Sync for SqliteStore
impl !UnwindSafe for SqliteStore
impl Forget for SqliteStore
impl Send for SqliteStore
impl Unpin for SqliteStore
impl UnsafeUnpin for SqliteStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more