pub fn create_or_fetch_relationship(
conn: &Connection,
namespace: &str,
source_id: i64,
target_id: i64,
relation: &str,
weight: f64,
description: Option<&str>,
) -> Result<(i64, bool), AppError>Expand description
Creates a relation if it does not exist (returns action=“created”) or returns the existing relation (action=“already_exists”) with updated weight.
§Errors
AppError::Database— SQLite query or constraint failure.AppError::Validation— self-link attempt (source equals target).