pub struct SqliteRunLogStore { /* private fields */ }Expand description
SQLite-backed RunLogStore.
Implementations§
Source§impl SqliteRunLogStore
impl SqliteRunLogStore
Sourcepub async fn new(path: impl AsRef<Path>) -> Result<Self, RunLogError>
pub async fn new(path: impl AsRef<Path>) -> Result<Self, RunLogError>
Open or create the database file at path and ensure the schema exists.
On open, ensures both cost_prompt_usd and cost_completion_usd
columns exist via ALTER TABLE … ADD COLUMN for forward-compatible
upgrade of pre-existing databases. Both columns are nullable so rows
written before the columns existed continue to read back as cost_estimate = None
(the prompt/completion split is genuinely unknown for rows written
before the split columns existed; fabricating 0.0 halves would
violate the audit-evidence invariant prompt + completion == total).
Trait Implementations§
Source§impl RunLogStore for SqliteRunLogStore
impl RunLogStore for SqliteRunLogStore
Source§fn put<'life0, 'life1, 'async_trait>(
&'life0 self,
run_log: &'life1 RunLog,
) -> Pin<Box<dyn Future<Output = Result<(), RunLogError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn put<'life0, 'life1, 'async_trait>(
&'life0 self,
run_log: &'life1 RunLog,
) -> Pin<Box<dyn Future<Output = Result<(), RunLogError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Persist (insert or replace) a
RunLog keyed by its run_id.Source§fn get<'life0, 'async_trait>(
&'life0 self,
run_id: RunId,
) -> Pin<Box<dyn Future<Output = Result<Option<RunLog>, RunLogError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get<'life0, 'async_trait>(
&'life0 self,
run_id: RunId,
) -> Pin<Box<dyn Future<Output = Result<Option<RunLog>, RunLogError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetch a
RunLog by run_id. Ok(None) when not present.Source§fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 RunLogQuery,
) -> Pin<Box<dyn Future<Output = Result<Vec<RunLog>, RunLogError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 RunLogQuery,
) -> Pin<Box<dyn Future<Output = Result<Vec<RunLog>, RunLogError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List runs most-recent-first, filtered and paginated per
RunLogQuery.
All filters (agent, status) are applied before limit/offset so the
returned page reflects the full filtered set, not a post-filtered slice.Auto Trait Implementations§
impl !RefUnwindSafe for SqliteRunLogStore
impl !UnwindSafe for SqliteRunLogStore
impl Freeze for SqliteRunLogStore
impl Send for SqliteRunLogStore
impl Sync for SqliteRunLogStore
impl Unpin for SqliteRunLogStore
impl UnsafeUnpin for SqliteRunLogStore
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