Expand description
Durable task persistence on the redb tasks table.
The whole Task record is stored as serde-json keyed by its
project and id - no field schema on disk, so a type change needs no
table migration. Machine-local, like the crons beside it.
Re-exportsยง
use anyhow::Context;๐use forge_primitives::tasks::Estimate;๐use forge_primitives::tasks::LinkKind;๐use forge_primitives::tasks::Task;๐use forge_primitives::tasks::TaskId;๐use forge_primitives::tasks::TaskLink;๐use forge_primitives::tasks::TaskStatus;๐use forge_primitives::tasks::Waiting;๐use redb::ReadableTable;๐use redb::TableDefinition;๐use super::Db;๐
Structsยง
- Task
Record ๐ - The stored shape:
Taskplus the two spellings earlier versions wrote -artifactas a bare string, andblockedas a status. Reads go through here so a legacy row loads as the record it meant rather than failing the whole set.
Enumsยง
- Record
Estimate ๐ - Record
Status ๐
Constantsยง
- TASKS ๐
Functionsยง
- delete
- Delete a task by project and id. Returns whether a record existed.
- list
- Every persisted task.
- row_key ๐
- The row key for a task: its project as well as its id, separated by a NUL a project name cannot carry.
- row_
key_ ๐for - The row key for a project and id, the pair
row_keyjoins. - upsert
- Persist one task, replacing any prior record for its project and id. One write txn per row, so a write can only touch the row it names.