pub struct SqliteDurableStore { /* private fields */ }Expand description
SQLite-backed durable workflow store.
Implementations§
Source§impl SqliteDurableStore
impl SqliteDurableStore
pub fn insert_local_task_and_run( &mut self, input: LocalTaskAndRunInsert<'_>, ) -> Result<()>
pub fn prepare_resume_run( &mut self, run_id: &str, owner_id: &str, now: i64, ) -> Result<(String, u32)>
pub fn start_attempt(&mut self, input: LocalAttemptStart<'_>) -> Result<()>
pub fn complete_attempt_and_task( &mut self, input: LocalAttemptComplete<'_>, ) -> Result<()>
pub fn fail_attempt(&mut self, input: LocalAttemptFail<'_>) -> Result<()>
pub fn cancel_attempt_and_task( &mut self, input: LocalAttemptCancel<'_>, ) -> Result<()>
pub fn claim_or_replay_agent_step( &mut self, input: AgentStepClaimInput<'_>, ) -> Result<AgentStepClaim>
pub fn complete_agent_step( &mut self, input: AgentStepCompleteInput<'_>, ) -> Result<()>
pub fn claim_or_replay_sleep_step( &mut self, input: SleepStepClaimInput<'_>, ) -> Result<SleepStepClaim>
pub fn complete_sleep_step( &mut self, input: SleepStepCompleteInput<'_>, ) -> Result<()>
pub fn fail_agent_step(&mut self, input: AgentStepFailInput<'_>) -> Result<()>
Source§impl SqliteDurableStore
impl SqliteDurableStore
Sourcepub fn open(path: impl AsRef<Path>) -> Result<Self>
pub fn open(path: impl AsRef<Path>) -> Result<Self>
Open a durable store at path and apply connection pragmas.
Sourcepub fn path(&self) -> Option<&Path>
pub fn path(&self) -> Option<&Path>
Return the durable database path when this store was opened from a file.
Sourcepub fn connection(&self) -> &Connection
pub fn connection(&self) -> &Connection
Borrow the underlying SQLite connection.
Sourcepub fn connection_mut(&mut self) -> &mut Connection
pub fn connection_mut(&mut self) -> &mut Connection
Mutably borrow the underlying SQLite connection.
Sourcepub fn init(&mut self) -> Result<usize>
pub fn init(&mut self) -> Result<usize>
Initialize the durable schema by applying all available migrations.
Sourcepub fn apply_migrations(&mut self, target_version: Option<i64>) -> Result<usize>
pub fn apply_migrations(&mut self, target_version: Option<i64>) -> Result<usize>
Apply migrations up to target_version, or all available migrations when
target_version is None.
Returns the number of migrations applied in this call.
Sourcepub fn migration_records(&self) -> Result<Vec<MigrationRecord>>
pub fn migration_records(&self) -> Result<Vec<MigrationRecord>>
Return applied migrations in ascending id order.
Sourcepub fn current_schema_version(&self) -> Result<i64>
pub fn current_schema_version(&self) -> Result<i64>
Return the latest applied migration id, or 0 when none are applied.
Auto Trait Implementations§
impl !Freeze for SqliteDurableStore
impl !RefUnwindSafe for SqliteDurableStore
impl !Sync for SqliteDurableStore
impl !UnwindSafe for SqliteDurableStore
impl Send for SqliteDurableStore
impl Unpin for SqliteDurableStore
impl UnsafeUnpin for SqliteDurableStore
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