pub struct SqliteBackend { /* private fields */ }Implementations§
Source§impl SqliteBackend
impl SqliteBackend
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
Source§fn get_prefix(&self, name: &str) -> KanbanResult<Option<Prefix>>
fn get_prefix(&self, name: &str) -> KanbanResult<Option<Prefix>>
Look a namespace up by name. Matching is case-insensitive, because the
identifier resolver lowercases before comparing; a case-sensitive
lookup would fork one namespace into two that each allocate from zero.
fn list_prefixes(&self) -> KanbanResult<Vec<Prefix>>
Source§fn upsert_prefix(&self, prefix: Prefix) -> KanbanResult<()>
fn upsert_prefix(&self, prefix: Prefix) -> KanbanResult<()>
Insert or replace by normalised name. Two spellings of one name are one
row.
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<()>
Source§fn get_card(&self, id: Uuid) -> KanbanResult<Option<Card>>
fn get_card(&self, id: Uuid) -> KanbanResult<Option<Card>>
Returns the row regardless of archival status: an archived card is
still
Some.Source§fn list_all_cards(&self) -> KanbanResult<Vec<Card>>
fn list_all_cards(&self) -> KanbanResult<Vec<Card>>
Excludes archived cards, so a card’s absence here is not evidence the
card is gone.
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>>
Source§fn list_cards_by_number(&self, card_number: u32) -> KanbanResult<Vec<Card>>
fn list_cards_by_number(&self, card_number: u32) -> KanbanResult<Vec<Card>>
Every live card numbered
card_number, in ANY namespace. Read moreSource§fn list_cards_by_prefix_and_number(
&self,
prefix: &str,
card_number: u32,
) -> KanbanResult<Vec<Card>>
fn list_cards_by_prefix_and_number( &self, prefix: &str, card_number: u32, ) -> KanbanResult<Vec<Card>>
Source§fn get_card_by_board_and_number(
&self,
board_id: Uuid,
card_number: u32,
) -> KanbanResult<Option<Card>>
fn get_card_by_board_and_number( &self, board_id: Uuid, card_number: u32, ) -> KanbanResult<Option<Card>>
Find the card numbered
card_number directly owned by board_id
(via Card.board_id, not via column membership). Returns None
when no live card matches. Default is an honest linear scan every
backend can answer; SQL-backed implementations should override with
an indexed single-row query.Source§fn get_card_by_sprint_and_number(
&self,
sprint_id: Uuid,
card_number: u32,
) -> KanbanResult<Option<Card>>
fn get_card_by_sprint_and_number( &self, sprint_id: Uuid, card_number: u32, ) -> KanbanResult<Option<Card>>
Find the card numbered
card_number directly owned by sprint_id.
Returns None when no live card matches. Default delegates to
list_cards_by_sprint; SQL-backed
implementations should override with an indexed single-row query.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
Source§impl KanbanBackend for SqliteBackend
impl KanbanBackend for SqliteBackend
Source§fn with_transaction(&self, f: TransactionFn<'_>) -> KanbanResult<()>
fn with_transaction(&self, f: TransactionFn<'_>) -> KanbanResult<()>
Real BEGIN/COMMIT/ROLLBACK transaction rather than a
snapshot-and-restore rollback.
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 probe<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), KanbanError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn probe<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), KanbanError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Forces one cheap I/O so a broken backend fails at construction
instead of on first use. The default reads the command log, which
every local backend loads lazily; a remote backend overrides this
with a network liveness check.
Source§fn mark_dirty(&self)
fn mark_dirty(&self)
Marks the backend dirty without performing a write, so a subsequent
flush() (or needs_save_worker()-driven background flush) picks it
up. No-op by default for write-through backends that have no dirty
flag to set.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 compatibility_notice(&self) -> Option<CompatibilityNotice>
fn compatibility_notice(&self) -> Option<CompatibilityNotice>
Some(…) when the last
probe() found the remote server older than
this binary, or unable to report a comparable version.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 remote_board_writes(&self) -> Option<&dyn RemoteBoardWrites>
fn remote_board_writes(&self) -> Option<&dyn RemoteBoardWrites>
Per-family counterparts to
remote_writes(). None by default for
every backend; a backend overrides only the families it supports.Source§fn remote_card_writes(&self) -> Option<&dyn RemoteCardWrites>
fn remote_card_writes(&self) -> Option<&dyn RemoteCardWrites>
See
remote_board_writes().Source§fn remote_batch_writes(&self) -> Option<&dyn RemoteBatchWrites>
fn remote_batch_writes(&self) -> Option<&dyn RemoteBatchWrites>
See
remote_board_writes().Source§fn remote_sprint_writes(&self) -> Option<&dyn RemoteSprintWrites>
fn remote_sprint_writes(&self) -> Option<&dyn RemoteSprintWrites>
See
remote_board_writes().Source§fn remote_graph_writes(&self) -> Option<&dyn RemoteGraphWrites>
fn remote_graph_writes(&self) -> Option<&dyn RemoteGraphWrites>
See
remote_board_writes().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