MCPcopy Create free account
hub / github.com/cortexkit/magic-context / queue_memory_mutation

Function queue_memory_mutation

packages/dashboard/src-tauri/src/db.rs:3138–3167  ·  view source on GitHub ↗
(
    tx: &Transaction<'_>,
    project_path: &str,
    mutation_type: &str,
    target_memory_id: i64,
    superseded_by_id: Option<i64>,
    category: Option<&str>,
    new_content: Option<&str>,
)

Source from the content-addressed store, hash-verified

3136}
3137
3138fn queue_memory_mutation(
3139 tx: &Transaction<'_>,
3140 project_path: &str,
3141 mutation_type: &str,
3142 target_memory_id: i64,
3143 superseded_by_id: Option<i64>,
3144 category: Option<&str>,
3145 new_content: Option<&str>,
3146) -> Result<(), rusqlite::Error> {
3147 // Store the row under the resolved identity (git:/dir:), mirroring the plugin's
3148 // queueMemoryMutation. The render-side filter queries by resolved identity, so a
3149 // raw-path row would be invisible to it. Idempotent on already-resolved paths
3150 // (every live memory row), defensive for any legacy raw path.
3151 let identity = normalize_stored_project_path(project_path);
3152 tx.execute(
3153 "INSERT INTO memory_mutation_log
3154 (project_path, mutation_type, target_memory_id, superseded_by_id, category, new_content, queued_at)
3155 VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7)",
3156 params![
3157 identity,
3158 mutation_type,
3159 target_memory_id,
3160 superseded_by_id,
3161 category,
3162 new_content,
3163 now_millis()
3164 ],
3165 )?;
3166 Ok(())
3167}
3168
3169fn bump_project_user_profile_version(tx: &Transaction<'_>) -> Result<(), rusqlite::Error> {
3170 tx.execute(

Callers 5

update_memory_statusFunction · 0.85
update_memory_contentFunction · 0.85
delete_memoryFunction · 0.85
bulk_delete_memoryFunction · 0.85

Calls 1

Tested by

no test coverage detected