Expand description
SQLite query helpers for the projection database.
Provides typed Rust structs and composable query functions for common access patterns: list/filter items, get by ID, search FTS5, retrieve dependencies, labels, assignees, and comments.
All functions take a shared &Connection reference and return
anyhow::Result<T> with typed structs (never raw rows).
Structs§
- Item
Filter - Filter criteria for item listings.
- Label
Count - Global label inventory row with usage count.
- Project
Stats - Aggregate counters for project-level stats used by reporting commands.
- Query
Assignee - An assignee of an item.
- Query
Comment - A comment attached to a work item.
- Query
Dependency - A dependency edge between two items.
- Query
Item - A projected work item row from the
itemstable. - Query
Label - A label attached to an item.
- Search
Hit - An FTS5 search hit with BM25 relevance score.
Enums§
- Sort
Order - Sort order for item listings.
Functions§
- count_
items - Count items matching the given filter criteria.
- event_
counts_ by_ agent - Count projected events by
agentfromprojected_events. - event_
counts_ by_ type - Count projected events by
event_typefromprojected_events. - get_
assignees - Get all assignees for an item.
- get_
children - Get child items of the given parent item.
- get_
comments - Get all comments for an item, newest first.
- get_
dependencies - Get items that a given item depends on (its blockers).
- get_
dependents - Get items that depend on the given item (its dependents / reverse deps).
- get_
item - Fetch a single item by exact
item_id. - get_
labels - Get all labels for an item.
- get_
projection_ cursor - Get the projection cursor metadata (last replay offset and hash).
- item_
counts_ by_ kind - Count projected items grouped by
kind, excluding deleted rows. - item_
counts_ by_ state - Count projected items grouped by
state, excluding deleted rows. - item_
counts_ by_ urgency - Count projected items grouped by
urgency, excluding deleted rows. - item_
exists - Check if an item exists in the projection.
- list_
items - List items matching the given filter criteria.
- list_
labels - List global label usage counts across all items.
- search
- Search items via FTS5 full-text search with BM25 ranking.
- try_
open_ projection - Attempt to open the projection database with graceful recovery.
- try_
open_ projection_ raw - Open the projection without triggering an auto-rebuild.
- update_
projection_ cursor - Update the projection cursor after replaying events.