Repository navigation
feat(storage): delete a vector index - #836
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A caller can delete a vector index from a vector bucket through
storage.Vectors.From(bucket).Capability:
storage.vector_buckets.delete_index— Delete Vector Index. No capability spec exists for it.Public API
Fromsends nothing; it scopes later operations to the bucket.IVectorBucketis the home for the other index and vector operations.Behavior
POST {storage}/vector/DeleteIndex, body{"vectorBucketName": "...", "indexName": "..."}, service-role key.FromthrowsArgumentExceptionfor a blank bucket name andDeleteIndexAsyncfor a blank index name (null, empty or whitespace), before any I/O. Name formats are not validated client-side; the service owns them.SupabaseStorageExceptionwithStatusCode,Content,CodeandReasonset: 404S3VectorNotFoundException(bucket or index missing), 400 for a rejected name, 401/403 for a non-service-role caller (Reason.NotAuthorized), 500InternalError, and the 404 the service answers when the vector service is not enabled.Deviations from supabase-js
SupabaseStorageExceptioninstead of returning{ data, error }; returns nothing instead of{}.DeleteIndexAsync(indexName)on the bucket scope, as in supabase-jsfrom(bucket), rather thanfrom(bucket).index(name).Tests
DeleteVectorIndexContractTestsFrom, each failure mapping, cancellation, dynamic headersDeleteVectorIndexApprovalTestsDeleteVectorIndexTestsChanged-line coverage: 100% (34 lines). Mutation: 15/15 killed on changed lines, 0 survivors.
Notes
No E2E ran against a real service: the local stack does not serve the vector routes. The failure responses are pinned from the storage route source, not observed on a live service.
The request mechanics that delete-bucket and delete-index share (URL, headers, POST, name check) moved to
Storage/Common/VectorService.cs.StorageVectorBucketApinow delegates to it; behavior is unchanged.The wire body is a plain class because the Storage package has no PolySharp, so records and
initdo not compile there.