pub struct SqliteStore { /* private fields */ }Expand description
Rows keyed by (doc_id, sid, time_start), whose operations are immutable.
Rows stay pending until their actor prefix is contiguous and their
dependencies are stored. A field without history keeps each actor’s newest
write to it in pulsify_values, overwritten in place: the sequence numbers
of the writes it replaces hold nothing, and spans are computed when rows
are read.
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.
Sourcepub fn mark_deleted(&mut self, doc_id: &str, frames: &[Vec<u8>]) -> Result<()>
pub fn mark_deleted(&mut self, doc_id: &str, frames: &[Vec<u8>]) -> Result<()>
Retain local recovery data and permanently block the prefix, in one transaction.
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. 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.
Trait Implementations§
Source§impl DocumentStore for SqliteStore
impl DocumentStore for SqliteStore
fn is_deleted(&self, doc_id: &str) -> Result<bool>
fn delete_documents( &mut self, doc_id: &str, preserve_rows: bool, ) -> Result<usize>
fn recover_rows(&self, doc_id: &str) -> Result<Vec<PatchRow>>
fn documents( &self, doc_id: &str, after: &str, limit: usize, ) -> Result<Vec<String>>
Source§impl PatchStore for SqliteStore
impl PatchStore for SqliteStore
Source§fn append(&mut self, rows: &[PatchRow]) -> Result<AppendResult>
fn append(&mut self, rows: &[PatchRow]) -> Result<AppendResult>
fn vector(&self, doc_id: &str) -> Result<VersionVector>
Source§fn missing(&self, doc_id: &str, remote: &VersionVector) -> Result<Vec<PatchRow>>
fn missing(&self, doc_id: &str, remote: &VersionVector) -> Result<Vec<PatchRow>>
Source§fn sync_state(
&mut self,
doc_id: &str,
remote: &VersionVector,
) -> Result<(Vec<PatchRow>, VersionVector)>
fn sync_state( &mut self, doc_id: &str, remote: &VersionVector, ) -> Result<(Vec<PatchRow>, VersionVector)>
missing and vector from one consistent snapshot.