Skip to content

feat(storage): delete a vector bucket - #830

Merged
Tr00d merged 2 commits into
masterfrom
feat/storage.vector_buckets.delete_vector_bucket
Nov 23, 2026
Merged

Tr00d merged 2 commits into
masterfrom
feat/storage.vector_buckets.delete_vector_bucket

Conversation

@Tr00d

@Tr00d Tr00d commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Summary

A caller can delete a vector bucket through the new Vectors entry point on the Storage client.

Capability: storage.vector_buckets.delete_vector_bucket — Delete Vector Bucket. No capability spec exists for it.

Public API

// IStorageClient<TBucket, TFileObject>
IStorageVectorBucketApi Vectors { get; }

// IStorageVectorBucketApi (new)
Task DeleteVectorBucketAsync(string vectorBucketName, CancellationToken cancellationToken = default);
var storage = new Client(url, headers);
await storage.Vectors.DeleteVectorBucketAsync("embeddings-prod");

IStorageVectorBucketApi is the home for the other vector capabilities; the index and vector operations will extend it.

Behavior

  • Operation: POST {storage}/vector/DeleteVectorBucket, body {"vectorBucketName": "..."}, service-role key.
  • Input: vectorBucketName is required. ArgumentException for null, empty or whitespace before any I/O. The name format is not validated client-side; the service owns it.
  • Output: none. An empty 200 body is success.
  • Failures throw SupabaseStorageException with StatusCode, Content, Code and Reason set: 400 S3VectorBucketNotEmpty (bucket still has indexes), 404 S3VectorNotFoundException, 401/403 for a non-service-role caller (Reason.NotAuthorized), 500 InternalError, and the 404 the service answers when the vector service is not enabled.
  • State: none.

Deviations from supabase-js

  • Throws SupabaseStorageException instead of returning { data, error }; returns nothing instead of {}.
  • Exposed as Vectors.DeleteVectorBucketAsync, mirroring storage.vectors.

Tests

Tier Class Pins
Contract DeleteVectorBucketContractTests method, path, body, headers, trailing-slash URL, empty-body success, each failure mapping, cancellation, dynamic headers
Contract DeleteVectorBucketApprovalTests exact request body
Unit DeleteVectorBucketTests blank-name check, no request sent

Changed-line coverage: 100% (19 lines). Mutation: 10/10 killed on changed lines, 0 survivors.

Notes

No E2E ran against a real service: the local stack does not serve the vector routes. The not-empty, missing-bucket, non-service-role and feature-not-enabled responses are pinned from the storage route source, not observed on a live service.

IStorageClient was reformatted (file-scoped namespace, no BOM) because the format check rejects touched files that were not already conformant.

@Tr00d
Tr00d marked this pull request as ready for review November 23, 2026 15:35
@Tr00d
Tr00d merged commit 6e798fb into master Nov 23, 2026
7 checks passed
@Tr00d
Tr00d deleted the feat/storage.vector_buckets.delete_vector_bucket branch November 23, 2026 15:35
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.

1 participant