Skip to main content

SqliteRunStore

Struct SqliteRunStore 

Source
pub struct SqliteRunStore { /* private fields */ }
Expand description

SQLite-backed persistent RunStore.

Open with SqliteRunStore::open (file path) or SqliteRunStore::open_in_memory (tests). Both return the store plus an AsyncIsleDriver the caller must shutdown().await when done — dropping the driver without a shutdown call leaves the SQLite thread as-is until the process exits.

Implementations§

Source§

impl SqliteRunStore

Source

pub async fn open( path: impl AsRef<Path>, ) -> Result<(Self, AsyncIsleDriver), RunStoreError>

Open (or create) a SQLite database file and run the schema migrations.

Source

pub async fn open_in_memory() -> Result<(Self, AsyncIsleDriver), RunStoreError>

Open an ephemeral in-memory database (tests, doctests).

Trait Implementations§

Source§

impl RunStore for SqliteRunStore

Source§

fn name(&self) -> &str

Backend name — for diagnostics/logging.
Source§

fn create<'life0, 'async_trait>( &'life0 self, record: RunRecord, ) -> Pin<Box<dyn Future<Output = Result<(), RunStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create a new Run row. Returns Duplicate if record.id is already stored.
Source§

fn get<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 RunId, ) -> Pin<Box<dyn Future<Output = Result<RunRecord, RunStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch a Run by id.
Source§

fn list_by_task<'life0, 'life1, 'async_trait>( &'life0 self, task_id: &'life1 TaskId, ) -> Pin<Box<dyn Future<Output = Result<Vec<RunRecord>, RunStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

List every Run kicked from task_id, ascending by created_at (oldest kick first).
Source§

fn append_step_entry<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 RunId, entry: StepEntry, ) -> Pin<Box<dyn Future<Output = Result<(), RunStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Append one step-trace entry to a Run’s step_entries, bumping updated_at to now.
Source§

fn update_status<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 RunId, status: RunStatus, ) -> Pin<Box<dyn Future<Output = Result<(), RunStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Update a Run’s status, bumping updated_at to now.
Source§

fn set_result<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 RunId, result_ref: Value, ) -> Pin<Box<dyn Future<Output = Result<(), RunStoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Set a Run’s terminal result_ref, bumping updated_at to now.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> MaybeSend for T

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more