pub struct SqliteBackend { /* private fields */ }Implementations§
Source§impl SqliteBackend
impl SqliteBackend
pub async fn open(locator: &str) -> KanbanResult<Self>
Trait Implementations§
Source§impl CommandStore for SqliteBackend
impl CommandStore for SqliteBackend
Source§fn load_all_batches(&self) -> KanbanResult<(Vec<CommandBatch>, u64)>
fn load_all_batches(&self) -> KanbanResult<(Vec<CommandBatch>, u64)>
Delegate to the mirror’s atomic count+load rather than the non-atomic trait default, so a concurrent append cannot land between the count and the load.
Source§fn append_batch(&self, batch: &CommandBatch) -> KanbanResult<u64>
fn append_batch(&self, batch: &CommandBatch) -> KanbanResult<u64>
Append one batch as a single entry. Returns the new entry count.
fn batch_count(&self) -> KanbanResult<u64>
Source§fn load_batches(&self, from: u64, to: u64) -> KanbanResult<Vec<CommandBatch>>
fn load_batches(&self, from: u64, to: u64) -> KanbanResult<Vec<CommandBatch>>
Half-open range
[from, to) of batches in chronological order.Source§impl DataStore for SqliteBackend
impl DataStore for SqliteBackend
fn get_board(&self, id: Uuid) -> KanbanResult<Option<Board>>
fn list_boards(&self) -> KanbanResult<Vec<Board>>
fn upsert_board(&self, board: Board) -> KanbanResult<()>
fn delete_board(&self, id: Uuid) -> KanbanResult<()>
fn get_column(&self, id: Uuid) -> KanbanResult<Option<Column>>
fn list_columns_by_board(&self, board_id: Uuid) -> KanbanResult<Vec<Column>>
fn list_all_columns(&self) -> KanbanResult<Vec<Column>>
fn upsert_column(&self, column: Column) -> KanbanResult<()>
fn delete_column(&self, id: Uuid) -> KanbanResult<()>
fn delete_columns_by_board(&self, board_id: Uuid) -> KanbanResult<()>
fn get_card(&self, id: Uuid) -> KanbanResult<Option<Card>>
fn list_all_cards(&self) -> KanbanResult<Vec<Card>>
fn list_cards_by_column(&self, column_id: Uuid) -> KanbanResult<Vec<Card>>
Source§fn list_cards_by_columns(&self, column_ids: &[Uuid]) -> KanbanResult<Vec<Card>>
fn list_cards_by_columns(&self, column_ids: &[Uuid]) -> KanbanResult<Vec<Card>>
Return all cards across the given columns in one call. Read more
fn list_cards_by_sprint(&self, sprint_id: Uuid) -> KanbanResult<Vec<Card>>
fn count_cards_in_column(&self, column_id: Uuid) -> KanbanResult<usize>
fn count_cards_in_column_excluding( &self, column_id: Uuid, exclude: &[Uuid], ) -> KanbanResult<usize>
Source§fn list_cards_by_column_filtered(
&self,
column_id: Uuid,
archived: ArchivedFilter,
) -> KanbanResult<Vec<Card>>
fn list_cards_by_column_filtered( &self, column_id: Uuid, archived: ArchivedFilter, ) -> KanbanResult<Vec<Card>>
Filter-aware column read. The default serves
LiveOnly by delegating to
list_cards_by_column and fails LOUD for
any archived-aware filter — no silent live-only fallback (per the repo
“semantic floor” rule). Backends that store archived cards override this
to honour ArchivedOnly and
Include.Source§fn count_cards_in_column_filtered(
&self,
column_id: Uuid,
archived: ArchivedFilter,
) -> KanbanResult<usize>
fn count_cards_in_column_filtered( &self, column_id: Uuid, archived: ArchivedFilter, ) -> KanbanResult<usize>
Filter-aware column count. Mirrors
list_cards_by_column_filtered:
LiveOnly delegates to count_cards_in_column,
archived-aware filters fail loud until a backend overrides.fn upsert_card(&self, card: Card) -> KanbanResult<()>
fn delete_card(&self, id: Uuid) -> KanbanResult<()>
fn delete_cards_by_columns(&self, column_ids: &[Uuid]) -> KanbanResult<()>
fn clear_sprint_from_cards( &self, sprint_id: Uuid, timestamp: DateTime<Utc>, ) -> KanbanResult<()>
fn get_archived_card(&self, card_id: Uuid) -> KanbanResult<Option<ArchivedCard>>
fn list_archived_cards(&self) -> KanbanResult<Vec<ArchivedCard>>
fn insert_archived_card(&self, ac: ArchivedCard) -> KanbanResult<()>
fn delete_archived_card(&self, card_id: Uuid) -> KanbanResult<()>
fn get_archived_board( &self, board_id: Uuid, ) -> KanbanResult<Option<ArchivedBoard>>
fn list_archived_boards(&self) -> KanbanResult<Vec<ArchivedBoard>>
fn insert_archived_board(&self, ab: ArchivedBoard) -> KanbanResult<()>
Source§fn delete_archived_board(&self, board_id: Uuid) -> KanbanResult<()>
fn delete_archived_board(&self, board_id: Uuid) -> KanbanResult<()>
Remove a board from the archived collection only. On a marker-style
backend (SQLite) this also removes the shared entity row, so it MUST be a
no-op on a live (non-archived) board — matching the in-memory store,
which only touches its archived map.
RestoreBoard relies on this: it
calls delete_archived_board BEFORE re-inserting the board as live
(delete-then-upsert), so re-adding it doesn’t collide with the archived
row on a shared-row backend.Source§fn unarchive_board(&self, board_id: Uuid) -> KanbanResult<()>
fn unarchive_board(&self, board_id: Uuid) -> KanbanResult<()>
Remove a board from the archived collection while KEEPING its shared
entity row and subtree (the RESTORE path). The default delegates to
delete_archived_board, which is correct
for map-style backends (in-memory/JSON) whose delete_archived_board
only drops the head from the archived map and never touches the subtree.
A shared-row backend (SQLite), whose delete_archived_board deletes the
entity row (needed for permanent delete), MUST override this to drop only
the archived marker — otherwise RestoreBoard (delete-archived then
upsert-head) would CASCADE the still-present subtree away (KAN-863).Source§fn list_archived_cards_by_board(
&self,
board_id: Uuid,
) -> KanbanResult<Vec<ArchivedCard>>
fn list_archived_cards_by_board( &self, board_id: Uuid, ) -> KanbanResult<Vec<ArchivedCard>>
Board-scoped archived cards. Default filters the full list by the
board_id field now carried on each ArchivedCard (B1). SQL backends
override with a single WHERE board_id = ? query.fn clear_sprint_from_archived_cards( &self, sprint_id: Uuid, timestamp: DateTime<Utc>, ) -> KanbanResult<()>
fn get_sprint(&self, id: Uuid) -> KanbanResult<Option<Sprint>>
fn list_sprints_by_board(&self, board_id: Uuid) -> KanbanResult<Vec<Sprint>>
fn list_all_sprints(&self) -> KanbanResult<Vec<Sprint>>
fn upsert_sprint(&self, sprint: Sprint) -> KanbanResult<()>
fn delete_sprint(&self, id: Uuid) -> KanbanResult<()>
fn delete_sprints_by_board(&self, board_id: Uuid) -> KanbanResult<()>
fn get_graph(&self) -> KanbanResult<DependencyGraph>
fn set_graph(&self, graph: DependencyGraph) -> KanbanResult<()>
Source§fn modify_graph(&self, f: GraphMutFn) -> KanbanResult<()>
fn modify_graph(&self, f: GraphMutFn) -> KanbanResult<()>
Atomically read-modify-write the dependency graph. Read more
fn snapshot(&self) -> KanbanResult<Snapshot>
fn apply_snapshot(&self, snapshot: Snapshot) -> KanbanResult<()>
Source§impl KanbanBackend for SqliteBackend
impl KanbanBackend for SqliteBackend
Source§fn as_data_store(&self) -> &dyn DataStore
fn as_data_store(&self) -> &dyn DataStore
Upcast to
&dyn DataStore.Source§fn flush<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = KanbanResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn flush<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = KanbanResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Persist any cached writes to durable storage.
Source§fn instance_id(&self) -> Uuid
fn instance_id(&self) -> Uuid
Stable instance UUID used for own-write detection in file watchers.
Source§fn local_persistence(&self) -> Option<&dyn LocalPersistence>
fn local_persistence(&self) -> Option<&dyn LocalPersistence>
Some(…) when this backend can report format version, writer kanban
version, writer commit, and last save time (JSON, SQLite).
None
(the default) for backends with no durable local store (InMemory,
Http) or that don’t track it (MockBackend).Source§fn reload<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), KanbanError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn reload<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), KanbanError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Discard cached state so the next read re-fetches from storage.
Source§fn needs_flush(&self) -> bool
fn needs_flush(&self) -> bool
Returns
true when there are writes that have not been flushed yet.Source§fn needs_save_worker(&self) -> bool
fn needs_save_worker(&self) -> bool
Returns
true for backends (JSON) that require a background flush
worker. Always false for write-through backends (SQLite, in-memory).Source§fn health_checker(&self) -> Option<Box<dyn HealthChecker>>
fn health_checker(&self) -> Option<Box<dyn HealthChecker>>
Returns a health checker for this backend, if supported.
The default returns
None; backends that can self-diagnose
(file readable, connection pool alive) override this.Source§fn remote_writes(&self) -> Option<&dyn RemoteWrites>
fn remote_writes(&self) -> Option<&dyn RemoteWrites>
Some(…) when this backend wants create/update/delete for board/column/
card to bypass local command execution entirely (an HTTP backend, where
the remote server is authoritative).
None (the default) for every local
backend — zero behavior change for JSON/SQLite/InMemory.Source§fn with_transaction(
&self,
f: &mut dyn FnMut() -> Result<(), KanbanError>,
) -> Result<(), KanbanError>
fn with_transaction( &self, f: &mut dyn FnMut() -> Result<(), KanbanError>, ) -> Result<(), KanbanError>
Run
f as an atomic batch: every mutation commits or rolls
back together. The default impl snapshots state before f
runs and restores it on failure — cheap for in-memory backends,
expensive on disk. Disk-backed backends should override with a
native transaction.Source§impl LocalPersistence for SqliteBackend
impl LocalPersistence for SqliteBackend
fn persistence_metadata(&self) -> Option<PersistenceMetadata>
Auto Trait Implementations§
impl !Freeze for SqliteBackend
impl !RefUnwindSafe for SqliteBackend
impl !UnwindSafe for SqliteBackend
impl Send for SqliteBackend
impl Sync for SqliteBackend
impl Unpin for SqliteBackend
impl UnsafeUnpin for SqliteBackend
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