pub struct SqlStore { /* private fields */ }Implementations§
Source§impl SqlStore
impl SqlStore
Sourcepub async fn scan_batch(
&self,
limit: usize,
) -> Result<Vec<SyncItem>, StorageError>
pub async fn scan_batch( &self, limit: usize, ) -> Result<Vec<SyncItem>, StorageError>
Scan a batch of items (for WAL drain).
Sourcepub async fn delete_batch(&self, ids: &[String]) -> Result<usize, StorageError>
pub async fn delete_batch(&self, ids: &[String]) -> Result<usize, StorageError>
Delete multiple items by ID in a single query.
Sourcepub async fn get_dirty_merkle_ids(
&self,
limit: usize,
) -> Result<Vec<String>, StorageError>
pub async fn get_dirty_merkle_ids( &self, limit: usize, ) -> Result<Vec<String>, StorageError>
Get IDs of items with merkle_dirty = 1 (need merkle recalculation).
Used by background merkle processor to batch recalculate affected trees.
Sourcepub async fn count_dirty_merkle(&self) -> Result<u64, StorageError>
pub async fn count_dirty_merkle(&self) -> Result<u64, StorageError>
Count items with merkle_dirty = 1.
Sourcepub async fn mark_merkle_clean(
&self,
ids: &[String],
) -> Result<usize, StorageError>
pub async fn mark_merkle_clean( &self, ids: &[String], ) -> Result<usize, StorageError>
Mark items as merkle-clean after recalculation.
Sourcepub async fn has_dirty_merkle(&self) -> Result<bool, StorageError>
pub async fn has_dirty_merkle(&self) -> Result<bool, StorageError>
Check if there are any dirty merkle items.
Sourcepub async fn get_dirty_merkle_items(
&self,
limit: usize,
) -> Result<Vec<SyncItem>, StorageError>
pub async fn get_dirty_merkle_items( &self, limit: usize, ) -> Result<Vec<SyncItem>, StorageError>
Get full SyncItems with merkle_dirty = 1 (need merkle recalculation).
Returns the items themselves so merkle can be calculated.
Use mark_merkle_clean() after processing to clear the flag.
Trait Implementations§
Source§impl ArchiveStore for SqlStore
impl ArchiveStore for SqlStore
Source§fn put_batch<'life0, 'life1, 'async_trait>(
&'life0 self,
items: &'life1 mut [SyncItem],
) -> Pin<Box<dyn Future<Output = Result<BatchWriteResult, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn put_batch<'life0, 'life1, 'async_trait>(
&'life0 self,
items: &'life1 mut [SyncItem],
) -> Pin<Box<dyn Future<Output = Result<BatchWriteResult, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Write a batch of items in a single multi-row INSERT with verification.
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<SyncItem>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn put<'life0, 'life1, 'async_trait>(
&'life0 self,
item: &'life1 SyncItem,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn exists<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn exists<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check if an item exists (SQL EXISTS query - fast, no data transfer).
Source§fn scan_keys<'life0, 'async_trait>(
&'life0 self,
offset: u64,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn scan_keys<'life0, 'async_trait>(
&'life0 self,
offset: u64,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Scan keys for cuckoo filter warmup (paginated).
Returns empty vec when offset exceeds total count.
Auto Trait Implementations§
impl Freeze for SqlStore
impl !RefUnwindSafe for SqlStore
impl Send for SqlStore
impl Sync for SqlStore
impl Unpin for SqlStore
impl !UnwindSafe for SqlStore
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