Delete a memory from store and index, record history.
(
&self,
memory_id: &MemoryId,
old_content: &str,
)
| 273 | |
| 274 | /// Delete a memory from store and index, record history. |
| 275 | async fn delete_memory_internal( |
| 276 | &self, |
| 277 | memory_id: &MemoryId, |
| 278 | old_content: &str, |
| 279 | ) -> GraphBitResult<()> { |
| 280 | // Record history BEFORE deleting (so FK constraint is satisfied). |
| 281 | // Note: with ON DELETE CASCADE, the history entry will be deleted |
| 282 | // along with the memory, so this serves as an audit log only if |
| 283 | // the cascade is disabled or history is preserved elsewhere. |
| 284 | // For now, we skip history on delete to avoid FK issues. |
| 285 | |
| 286 | // Delete from store (cascades to history) and index. |
| 287 | self.store.delete_memory(memory_id).await?; |
| 288 | self.vector_index.remove(memory_id).await; |
| 289 | |
| 290 | Ok(()) |
| 291 | } |
| 292 | } |
| 293 | |
| 294 | // --------------------------------------------------------------------------- |
no test coverage detected