unlink

gest iteration unlink: remove a relationship between an iteration and another entity.

struct Command

source

pub struct Command

Remove a relationship between an iteration and another entity.

Field Type Description
id String The iteration ID or prefix.
target String The target entity ID or prefix.
artifact bool Target is an artifact instead of another iteration.
rel Option<RelationshipType> The relationship type (e.g. blocks, blocked-by, relates-to). Required when multiple edges exist.
output json::Flags The output mode: normal, --json, --quiet or --raw.

Implements FromArgMatches, Args, Debug.

Command::call

source

pub async fn call(&self, context: &AppContext) -> Result<(), Error>

Delete the matching relationship row (and its reciprocal for iteration-to-iteration edges) within a recorded transaction so the operation can be undone atomically.

Parameter Type Description
context &AppContext the application context: settings, store and current project
returns Result<(), Error> Ok(()) when the command succeeds, or the error that stopped it.

fn record_and_delete

source

async fn record_and_delete(
    conn: &libsql::Connection,
    transaction_id: &crate::store::model::primitives::Id,
    rel: &Model,
) -> Result<(), Error>

Record a deleted event for rel and then remove the row.

The audit payload mirrors the on-disk relationships schema so transaction::undo can re-insert the row.

Parameter Type Description
conn &libsql::Connection the database connection
transaction_id &crate::store::model::primitives::Id the recorded transaction that the event belongs to
rel &Model the relationship row to delete
returns Result<(), Error> Ok(()), or the store error.