pub struct ExecutionStore { /* private fields */ }Expand description
Execution storage layer
Implementations§
Source§impl ExecutionStore
impl ExecutionStore
Sourcepub fn new(pool: DatabasePool) -> Self
pub fn new(pool: DatabasePool) -> Self
Create a new execution store
Sourcepub async fn create(&self, ctx: &ExecutionContext) -> Result<Uuid>
pub async fn create(&self, ctx: &ExecutionContext) -> Result<Uuid>
Create a new execution record
Sourcepub async fn batch_create(&self, contexts: &[ExecutionContext]) -> Result<u64>
pub async fn batch_create(&self, contexts: &[ExecutionContext]) -> Result<u64>
Batch create multiple execution records
This is more efficient than calling create() multiple times
as it uses a single database transaction.
Returns the number of executions created.
Sourcepub async fn list_by_workflow(
&self,
workflow_id: &WorkflowId,
) -> Result<Vec<(Uuid, ExecutionContext)>>
pub async fn list_by_workflow( &self, workflow_id: &WorkflowId, ) -> Result<Vec<(Uuid, ExecutionContext)>>
List executions for a specific workflow
Sourcepub async fn list_paginated(
&self,
limit: i64,
offset: i64,
) -> Result<Vec<(Uuid, ExecutionContext)>>
pub async fn list_paginated( &self, limit: i64, offset: i64, ) -> Result<Vec<(Uuid, ExecutionContext)>>
List executions with pagination
Sourcepub async fn update(&self, id: &Uuid, ctx: &ExecutionContext) -> Result<bool>
pub async fn update(&self, id: &Uuid, ctx: &ExecutionContext) -> Result<bool>
Update an execution
Sourcepub async fn count_by_state(&self, state: &str) -> Result<i64>
pub async fn count_by_state(&self, state: &str) -> Result<i64>
Count executions by state
Sourcepub async fn get_active(&self) -> Result<Vec<(Uuid, ExecutionContext)>>
pub async fn get_active(&self) -> Result<Vec<(Uuid, ExecutionContext)>>
Get active executions (Running or Paused)
Sourcepub async fn delete_by_workflow(&self, workflow_id: &WorkflowId) -> Result<u64>
pub async fn delete_by_workflow(&self, workflow_id: &WorkflowId) -> Result<u64>
Delete all executions for a specific workflow Returns the number of executions deleted
Trait Implementations§
Source§impl Clone for ExecutionStore
impl Clone for ExecutionStore
Source§fn clone(&self) -> ExecutionStore
fn clone(&self) -> ExecutionStore
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ExecutionStore
impl !RefUnwindSafe for ExecutionStore
impl Send for ExecutionStore
impl Sync for ExecutionStore
impl Unpin for ExecutionStore
impl !UnwindSafe for ExecutionStore
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more