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_read_only(path: impl AsRef<Path>) -> Result<Self, SqliteStoreError>
pub fn open_read_only(path: impl AsRef<Path>) -> Result<Self, SqliteStoreError>
Opens an existing database without creating schema or permitting writes.
§Errors
Returns SqliteStoreError when the database cannot be opened.
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 ArtifactStore for SqliteStore
impl ArtifactStore for SqliteStore
Source§fn put(
&self,
write: ArtifactWrite,
) -> ArtifactFuture<'_, Result<ArtifactRef, ArtifactError>>
fn put( &self, write: ArtifactWrite, ) -> ArtifactFuture<'_, Result<ArtifactRef, ArtifactError>>
Source§fn get(
&self,
reference: &ArtifactRef,
) -> ArtifactFuture<'_, Result<Artifact, ArtifactError>>
fn get( &self, reference: &ArtifactRef, ) -> ArtifactFuture<'_, Result<Artifact, ArtifactError>>
Source§fn list(
&self,
scope: &ArtifactScope,
after: Option<&str>,
limit: u32,
) -> ArtifactFuture<'_, Result<ArtifactPage, ArtifactError>>
fn list( &self, scope: &ArtifactScope, after: Option<&str>, limit: u32, ) -> ArtifactFuture<'_, Result<ArtifactPage, ArtifactError>>
Source§fn delete(
&self,
scope: &ArtifactScope,
artifact_id: &str,
) -> ArtifactFuture<'_, Result<bool, ArtifactError>>
fn delete( &self, scope: &ArtifactScope, artifact_id: &str, ) -> ArtifactFuture<'_, Result<bool, ArtifactError>>
Source§fn purge_expired(
&self,
scope: &ArtifactScope,
now_unix_ms: u64,
limit: u32,
) -> ArtifactFuture<'_, Result<u32, ArtifactError>>
fn purge_expired( &self, scope: &ArtifactScope, now_unix_ms: u64, limit: u32, ) -> ArtifactFuture<'_, Result<u32, ArtifactError>>
limit expired artifacts in one scope.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>
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>
Source§impl Clone for SqliteStore
impl Clone for SqliteStore
Source§fn clone(&self) -> SqliteStore
fn clone(&self) -> SqliteStore
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more