Add a native ClearStore endpoint to Ahnlich DB
- Dominant language
- Rust
- Stars
- 244
- Forks
- 29
- Avg merge
- 2d 41m
- Merged PRs (30d)
- 19
Description
VectorDBZ (#396) requires a way to delete all entries in a store without dropping the store itself.
This could currently be done by listing entries and sending their embedding keys back through multiple `DelKey` requests. However, this adds unnecessary network calls and could leave the store partially cleared if one request fails.
I propose adding a native `ClearStore` endpoint that accepts a store name and optional schema. A predicate condition is unnecessary because DelPred already supports conditional deletion.
`ClearStore` should:
- Delete all entries through the internal deletion path.
- Preserve the store name, schema, dimension, creation date, predicate indexes, and non-linear index configuration.
- Return the number of deleted entries.
- Update the persistence state.
- Be replicated as a single mutation.
- Return an appropriate error when the store does not exist.
The existing store should be cleared in place rather than dropped and recreated.
Contributor guide
Research direction
Trace the existing DelKey and DelPred endpoint paths and the internal deletion path first. Check how persistence updates and replication represent mutations, then verify ClearStore preserves the listed store metadata, returns the deleted-entry count, handles missing stores, and is replicated as one mutation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend-api-design, databases, distributed-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100