Supabase. Storage. Vector. Behaviour behaviour
(supabase_storage v0.6.1)
Copy Markdown
Defines the behaviour interface for vector bucket operations.
This behaviour specifies the contract that implementations of vector storage management must follow. It includes operations for creating, retrieving, listing, and deleting vector buckets.
Summary
Types
Vector client instance
Supabase client instance
Options for listing vector buckets.
Vector bucket metadata
Types
@type bucket() :: Supabase.Storage.Vector.t()
Vector client instance
@type client() :: Supabase.Client.t()
Supabase client instance
@type create_index_opt() :: {:vector_bucket_name, String.t()} | {:index_name, String.t()} | {:data_type, Supabase.Storage.Vector.Index.data_type()} | {:distance_metric, Supabase.Storage.Vector.Index.distance_metric()} | {:metadata_configuration, %{non_filterable_metadata_keys: [String.t()]} | nil}
@type list_opt() :: {:prefix, String.t() | nil} | {:max_results, integer() | nil} | {:next_token, String.t() | nil}
Options for listing vector buckets.
Options
{:prefix, String.t() | nil}- Filter buckets by name prefix{:max_results, integer | nil}- Maximum number of results to return (default: 100){:next_token, String.t() | nil}- Pagination token from previous response
@type metadata() :: Supabase.Storage.Vector.Metadata.t()
Vector bucket metadata
Callbacks
@callback create_bucket(bucket(), name :: String.t()) :: Supabase.result(:created)
@callback create_index(bucket(), Enumerable.t(create_index_opt())) :: Supabase.result(:created)
@callback delete_bucket(bucket(), name :: String.t()) :: Supabase.result(:deleted)
@callback delete_index(bucket(), name :: String.t()) :: Supabase.result(:deleted)
@callback from(client(), Enumerable.t(opt)) :: bucket() when opt: {:vector_bucket_name, String.t() | nil} | {:vector_index_name, String.t() | nil}
@callback get_bucket(bucket(), name :: String.t()) :: Supabase.result(metadata() | nil)
@callback get_index(bucket(), name :: String.t()) :: Supabase.result(Supabase.Storage.Vector.Index.t())
@callback list_buckets(bucket(), Enumerable.t(list_opt())) :: Supabase.result(%{ vector_buckets: [ %{vector_bucket_name: String.t(), next_token: String.t() | nil} ] })