pub struct SqliteStore { /* private fields */ }Expand description
Cloneable SQLite-backed effect, checkpoint, and journal store.
Clones share one connection and serialize operations at the connection
boundary. SQLite transactions still provide persistence and CAS guarantees
across separately opened store instances and processes.
Implementations§
Source§impl SqliteStore
impl SqliteStore
Sourcepub fn open(path: impl AsRef<Path>) -> Result<Self, SqliteStoreError>
pub fn open(path: impl AsRef<Path>) -> Result<Self, SqliteStoreError>
Opens or creates a file-backed store and initializes its schema.
§Errors
Returns SqliteStoreError when the database cannot be opened or
initialized.
Sourcepub fn open_in_memory() -> Result<Self, SqliteStoreError>
pub fn open_in_memory() -> Result<Self, SqliteStoreError>
Creates a process-local SQLite database, primarily for tests.
§Errors
Returns SqliteStoreError when SQLite initialization fails.
Sourcepub fn events(&self, run_id: RunId) -> Result<Vec<RunEvent>, SqliteStoreError>
pub fn events(&self, run_id: RunId) -> Result<Vec<RunEvent>, SqliteStoreError>
Loads all journal events for one Run in sequence order.
§Errors
Returns SqliteStoreError when querying or decoding fails.
Trait Implementations§
Source§impl CheckpointStore for SqliteStore
impl CheckpointStore for SqliteStore
Source§fn load(&self, id: CheckpointId) -> Result<Checkpoint, CheckpointError>
fn load(&self, id: CheckpointId) -> Result<Checkpoint, CheckpointError>
Loads the latest checkpoint revision. Read more
Source§fn compare_and_swap(
&self,
checkpoint: &Checkpoint,
expected_revision: Option<u64>,
) -> Result<(), CheckpointError>
fn compare_and_swap( &self, checkpoint: &Checkpoint, expected_revision: Option<u64>, ) -> Result<(), CheckpointError>
Creates or atomically replaces a checkpoint. Read more
Source§impl Clone for SqliteStore
impl Clone for SqliteStore
Source§fn clone(&self) -> SqliteStore
fn clone(&self) -> SqliteStore
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SqliteStore
impl Debug for SqliteStore
Source§impl EffectStore for SqliteStore
impl EffectStore for SqliteStore
Source§fn load(
&self,
id: EffectId,
) -> Result<Option<EffectRecord>, EffectExecutorError>
fn load( &self, id: EffectId, ) -> Result<Option<EffectRecord>, EffectExecutorError>
Loads a record by effect identity. Read more
Source§fn find_by_idempotency(
&self,
capability_id: CapabilityId,
key: &str,
) -> Result<Option<EffectRecord>, EffectExecutorError>
fn find_by_idempotency( &self, capability_id: CapabilityId, key: &str, ) -> Result<Option<EffectRecord>, EffectExecutorError>
Resolves a logical effect by capability-scoped idempotency key. Read more
Source§fn compare_and_swap(
&self,
record: &EffectRecord,
expected_revision: Option<u64>,
) -> Result<(), EffectExecutorError>
fn compare_and_swap( &self, record: &EffectRecord, expected_revision: Option<u64>, ) -> Result<(), EffectExecutorError>
Creates or atomically replaces a record. Read more
Auto Trait Implementations§
impl Freeze for SqliteStore
impl RefUnwindSafe for SqliteStore
impl Send for SqliteStore
impl Sync for SqliteStore
impl Unpin for SqliteStore
impl UnsafeUnpin for SqliteStore
impl UnwindSafe 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