pub struct SqliteStore { /* private fields */ }Expand description
sqlx/sqlite-backed durable event store.
Implementations§
Trait Implementations§
Source§impl Store for SqliteStore
impl Store for SqliteStore
Source§fn usage<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
since: &'life1 str,
until: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<UsageRow>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn usage<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
since: &'life1 str,
until: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<UsageRow>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Aggregated in SQL (JSON1 json_extract over the kind column) so a long
log is grouped by the database rather than replayed into memory. The
WHERE clause discards every other event kind before grouping, so
workspaces that only produced output never open a row.
Source§fn append<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 FleetEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn append<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 FleetEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Append one event to durable storage.
Source§fn replay<'life0, 'life1, 'async_trait>(
&'life0 self,
stream_key: &'life1 str,
from_seq: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<FleetEvent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn replay<'life0, 'life1, 'async_trait>(
&'life0 self,
stream_key: &'life1 str,
from_seq: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<FleetEvent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Replay events for one stream with
seq >= from_seq, in seq order.Source§fn high_water<'life0, 'life1, 'async_trait>(
&'life0 self,
stream_key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn high_water<'life0, 'life1, 'async_trait>(
&'life0 self,
stream_key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
The highest
seq ever persisted for stream_key (0 if none). Used to
resume that stream’s sequence counter across daemon restarts.Source§fn writable<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn writable<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Whether the backend can currently accept writes. A cheap, non-destructive
probe used by the readiness endpoint.
Source§fn prune<'life0, 'life1, 'async_trait>(
&'life0 self,
before_ts: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn prune<'life0, 'life1, 'async_trait>(
&'life0 self,
before_ts: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete events with
ts < before_ts (RFC-3339, lexically ordered).
Returns the number removed. Backs age-based retention (#4).Auto Trait Implementations§
impl Freeze for SqliteStore
impl !RefUnwindSafe for SqliteStore
impl Send for SqliteStore
impl Sync for SqliteStore
impl Unpin for SqliteStore
impl UnsafeUnpin for SqliteStore
impl !UnwindSafe for SqliteStore
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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