Remove a document and its index entry. Returns True if it existed.
(record_id: str)
| 72 | |
| 73 | |
| 74 | def delete_record(record_id: str) -> bool: |
| 75 | """Remove a document and its index entry. Returns True if it existed.""" |
| 76 | _ensure_storage() |
| 77 | path = STORAGE_DIR / f"{record_id}.json" |
| 78 | if not path.exists(): |
| 79 | return False |
| 80 | path.unlink() |
| 81 | index = load_index() |
| 82 | index.pop(record_id, None) |
| 83 | save_index(index) |
| 84 | return True |
| 85 | |
| 86 | |
| 87 | def list_records() -> list: |
no test coverage detected