Skip to main content

replace_config_rows

Function replace_config_rows 

Source
pub async fn replace_config_rows(
    tx: &mut Connection,
    table: &str,
    package_id: &str,
    records: &[Value],
) -> Result<(u64, i64), AppError>
Expand description

Replace all rows for a config type for one package: copy current (for this package_id) to history, delete, insert with new version. If incoming payloads are deep-equal to current, no write is performed and no new version is created. Returns (count inserted, version). Call within transaction for atomicity.