pub struct ExecutionStore { /* private fields */ }Expand description
ExecutionStore - Main store class for managing execution records
Implementations§
Source§impl ExecutionStore
impl ExecutionStore
Sourcepub fn with_options(options: ExecutionStoreOptions) -> Self
pub fn with_options(options: ExecutionStoreOptions) -> Self
Create a new ExecutionStore with options
Sourcepub fn read_lino_records(&self) -> Vec<ExecutionRecord>
pub fn read_lino_records(&self) -> Vec<ExecutionRecord>
Read all execution records from lino file
Sourcepub fn record_to_links_notation(&self, record: &ExecutionRecord) -> String
pub fn record_to_links_notation(&self, record: &ExecutionRecord) -> String
Convert a record’s properties to clink links notation.
The record is one link (uuid: ExecutionRecord uuid) plus one link per
property, (uuid.key: uuid "key=value"). Property links have the record
as their source, so records that share a value stay distinct links
(doublets are deduplicated by source and target), and the key= prefix
keeps a number from being read as a link address (issue #253).
Sourcepub fn build_clink_create_query(&self, record: &ExecutionRecord) -> String
pub fn build_clink_create_query(&self, record: &ExecutionRecord) -> String
Build the create query with the same notation as the property helper.
Sourcepub fn save(&self, record: &ExecutionRecord) -> Result<(), String>
pub fn save(&self, record: &ExecutionRecord) -> Result<(), String>
Save an execution record (creates or updates)
pub fn reserve_launch( &self, record: &ExecutionRecord, previous: &ExecutionRecord, ) -> Result<(), String>
Sourcepub fn patch_attempt(
&self,
uuid: &str,
number: u64,
fields: Value,
) -> Result<Option<ExecutionRecord>, String>
pub fn patch_attempt( &self, uuid: &str, number: u64, fields: Value, ) -> Result<Option<ExecutionRecord>, String>
Merge attempt metadata under the lock without replacing a watcher’s terminal state.
Sourcepub fn mark_container_removed(
&self,
uuid: &str,
observed_at: &str,
) -> Result<Option<ExecutionRecord>, String>
pub fn mark_container_removed( &self, uuid: &str, observed_at: &str, ) -> Result<Option<ExecutionRecord>, String>
Record that a finished execution’s container no longer exists (issue #225). Applied under the lock, and only while the record is still finished, so a concurrent resume is never undone.
Sourcepub fn get(&self, identifier: &str) -> Option<ExecutionRecord>
pub fn get(&self, identifier: &str) -> Option<ExecutionRecord>
Get an execution record by UUID, session name, earlier session name (issue #162), display name or alias (issue #231).
Sourcepub fn with_lock<F>(&self, mutate: F) -> Result<Option<ExecutionRecord>, String>
pub fn with_lock<F>(&self, mutate: F) -> Result<Option<ExecutionRecord>, String>
Run mutate on the stored records under the database lock and persist
them when it returns a changed record (issues #229, #231).
Sourcepub fn get_all(&self) -> Vec<ExecutionRecord>
pub fn get_all(&self) -> Vec<ExecutionRecord>
Get all execution records
Sourcepub fn get_by_status(&self, status: ExecutionStatus) -> Vec<ExecutionRecord>
pub fn get_by_status(&self, status: ExecutionStatus) -> Vec<ExecutionRecord>
Get records filtered by status
Sourcepub fn get_executing(&self) -> Vec<ExecutionRecord>
pub fn get_executing(&self) -> Vec<ExecutionRecord>
Get currently executing commands
Sourcepub fn get_recent(&self, limit: usize) -> Vec<ExecutionRecord>
pub fn get_recent(&self, limit: usize) -> Vec<ExecutionRecord>
Get recently executed commands (sorted by start_time descending)
Sourcepub fn cleanup_stale(&self, options: CleanupOptions) -> CleanupResult
pub fn cleanup_stale(&self, options: CleanupOptions) -> CleanupResult
Clean up stale “executing” records (processes no longer running or aged out)
Sourcepub fn verify_consistency(&self) -> ConsistencyResult
pub fn verify_consistency(&self) -> ConsistencyResult
Verify that both databases have consistent data
Sourcepub fn get_stats(&self) -> ExecutionStats
pub fn get_stats(&self) -> ExecutionStats
Get database statistics
Sourcepub fn app_folder(&self) -> &Path
pub fn app_folder(&self) -> &Path
Get the app folder path