pub struct SqliteConfigChangesStore { /* private fields */ }Implementations§
Source§impl SqliteConfigChangesStore
impl SqliteConfigChangesStore
Sourcepub async fn open(url: &str) -> Result<Self, ConfigChangesError>
pub async fn open(url: &str) -> Result<Self, ConfigChangesError>
Open or create the SQLite store at url. Pass
"sqlite::memory:" for tests. Schema is idempotent.
pub async fn open_in_memory() -> Result<Self, ConfigChangesError>
Trait Implementations§
Source§impl ConfigChangesStore for SqliteConfigChangesStore
impl ConfigChangesStore for SqliteConfigChangesStore
Source§fn record<'life0, 'life1, 'async_trait>(
&'life0 self,
row: &'life1 ConfigChangeRow,
) -> Pin<Box<dyn Future<Output = Result<(), ConfigChangesError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn record<'life0, 'life1, 'async_trait>(
&'life0 self,
row: &'life1 ConfigChangeRow,
) -> Pin<Box<dyn Future<Output = Result<(), ConfigChangesError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Idempotent on
(patch_id, status) — repeat insert with
the same key is a no-op. Caller passes one row per
state transition.Source§fn tail<'life0, 'async_trait>(
&'life0 self,
n: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<ConfigChangeRow>, ConfigChangesError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn tail<'life0, 'async_trait>(
&'life0 self,
n: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<ConfigChangeRow>, ConfigChangesError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Latest
n rows ordered by created_at DESC. Capped at
200 internally so a runaway tool call cannot pull the full
table into memory.Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
patch_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<ConfigChangeRow>, ConfigChangesError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
patch_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<ConfigChangeRow>, ConfigChangesError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Latest row for a given
patch_id, regardless of status.
Returns None when no row exists yet (proposal never
recorded — only happens during a race window between
staging file write and the first record).Auto Trait Implementations§
impl !RefUnwindSafe for SqliteConfigChangesStore
impl !UnwindSafe for SqliteConfigChangesStore
impl Freeze for SqliteConfigChangesStore
impl Send for SqliteConfigChangesStore
impl Sync for SqliteConfigChangesStore
impl Unpin for SqliteConfigChangesStore
impl UnsafeUnpin for SqliteConfigChangesStore
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> 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