pub async fn add_dependency(
pool: &SqlitePool,
blocking_task_id: i64,
blocked_task_id: i64,
) -> Result<Dependency>Expand description
Add a dependency between two tasks after checking for circular dependencies.
This is the safe way to add dependencies. It will:
- Verify both tasks exist
- Check for circular dependencies
- Add the dependency if safe
§Arguments
pool- Database connection poolblocking_task_id- ID of the task that must be completed firstblocked_task_id- ID of the task that depends on the blocking task
§Returns
Ok(Dependency)if the dependency was added successfullyErr(IntentError::CircularDependency)if adding would create a cycleErr(IntentError::TaskNotFound)if either task doesn’t exist