Skip to content

feat: add function to delete many records from vector db#11

Closed
NorbertKlockiewicz wants to merge 1 commit intomainfrom
@nk/delete-many
Closed

feat: add function to delete many records from vector db#11
NorbertKlockiewicz wants to merge 1 commit intomainfrom
@nk/delete-many

Conversation

@NorbertKlockiewicz
Copy link

Add bulk delete functionality to OPSQLiteVectorStore

This PR introduces a deleteMany method to the OPSQLiteVectorStore class that allows for efficient bulk deletion of vector records based on a predicate function.

Key changes:

  • Added deleteMany(predicate) method in packages/op-sqlite/src/wrappers/op-sqlite.ts:114-143
  • Method accepts a predicate function to filter which records to delete
  • Efficiently batches deletions using SQL IN clause with parameterized queries
  • Safely handles empty result sets (no unnecessary DELETE operations)

Functionality:

  • Retrieves all vectors from the database
  • Applies the provided predicate function to each SearchResult
  • Collects IDs of records that match the predicate
  • Performs a single bulk DELETE operation for all matching records

@jakmro jakmro closed this Oct 3, 2025
@jakmro jakmro deleted the @nk/delete-many branch October 10, 2025 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants