supabase

package
v0.3.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter struct {
	// contains filtered or unexported fields
}

Adapter wraps the Supabase client to implement the VectorDBClient interface

func NewAdapter

func NewAdapter(config *vectordb.Config) (*Adapter, error)

NewAdapter creates a new Supabase adapter

func (*Adapter) CollectionExists

func (a *Adapter) CollectionExists(ctx context.Context, name string) (bool, error)

CollectionExists checks if a collection exists

func (*Adapter) CreateCollection

func (a *Adapter) CreateCollection(ctx context.Context, name string, schema *vectordb.CollectionSchema) error

CreateCollection creates a new collection with the given schema

func (*Adapter) CreateDocument

func (a *Adapter) CreateDocument(ctx context.Context, collectionName string, document *vectordb.Document) error

CreateDocument creates a new document in the specified collection

func (*Adapter) CreateDocuments

func (a *Adapter) CreateDocuments(ctx context.Context, collectionName string, documents []*vectordb.Document) error

CreateDocuments creates multiple documents in batch

func (*Adapter) DeleteCollection

func (a *Adapter) DeleteCollection(ctx context.Context, name string) error

DeleteCollection deletes a collection and all its documents

func (*Adapter) DeleteDocument

func (a *Adapter) DeleteDocument(ctx context.Context, collectionName, documentID string) error

DeleteDocument deletes a document by ID

func (*Adapter) DeleteDocuments

func (a *Adapter) DeleteDocuments(ctx context.Context, collectionName string, documentIDs []string) error

DeleteDocuments deletes multiple documents by IDs

func (*Adapter) DeleteDocumentsByMetadata

func (a *Adapter) DeleteDocumentsByMetadata(ctx context.Context, collectionName string, metadata map[string]interface{}) error

DeleteDocumentsByMetadata deletes documents matching metadata criteria

func (*Adapter) GetCollectionCount

func (a *Adapter) GetCollectionCount(ctx context.Context, name string) (int64, error)

GetCollectionCount returns the number of documents in a collection

func (*Adapter) GetDefaultSchema

func (a *Adapter) GetDefaultSchema(schemaType vectordb.SchemaType, collectionName string) *vectordb.CollectionSchema

GetDefaultSchema returns a default schema for the given type

func (*Adapter) GetDocument

func (a *Adapter) GetDocument(ctx context.Context, collectionName, documentID string) (*vectordb.Document, error)

GetDocument retrieves a document by ID

func (*Adapter) GetSchema

func (a *Adapter) GetSchema(ctx context.Context, collectionName string) (*vectordb.CollectionSchema, error)

GetSchema retrieves the schema for a collection

func (*Adapter) Health

func (a *Adapter) Health(ctx context.Context) error

Health checks the health of the Supabase instance

func (*Adapter) ListCollections

func (a *Adapter) ListCollections(ctx context.Context) ([]vectordb.CollectionInfo, error)

ListCollections returns a list of all collections

func (*Adapter) ListDocuments

func (a *Adapter) ListDocuments(ctx context.Context, collectionName string, limit int, offset int) ([]*vectordb.Document, error)

ListDocuments returns a list of documents in a collection

func (*Adapter) SearchBM25

func (a *Adapter) SearchBM25(ctx context.Context, collectionName, query string, options *vectordb.QueryOptions) ([]*vectordb.QueryResult, error)

SearchBM25 performs keyword-based search using BM25

func (*Adapter) SearchByMetadata

func (a *Adapter) SearchByMetadata(ctx context.Context, collectionName string, metadata map[string]interface{}, options *vectordb.QueryOptions) ([]*vectordb.QueryResult, error)

SearchByMetadata searches documents by metadata fields

func (*Adapter) SearchHybrid

func (a *Adapter) SearchHybrid(ctx context.Context, collectionName, query string, options *vectordb.QueryOptions) ([]*vectordb.QueryResult, error)

SearchHybrid performs hybrid search combining vector and keyword search

func (*Adapter) SearchSemantic

func (a *Adapter) SearchSemantic(ctx context.Context, collectionName, query string, options *vectordb.QueryOptions) ([]*vectordb.QueryResult, error)

SearchSemantic performs semantic search using vector embeddings

func (*Adapter) UpdateDocument

func (a *Adapter) UpdateDocument(ctx context.Context, collectionName string, document *vectordb.Document) error

UpdateDocument updates an existing document

func (*Adapter) UpdateSchema

func (a *Adapter) UpdateSchema(ctx context.Context, collectionName string, schema *vectordb.CollectionSchema) error

UpdateSchema updates the schema for a collection

func (*Adapter) ValidateSchema

func (a *Adapter) ValidateSchema(schema *vectordb.CollectionSchema) error

ValidateSchema validates a schema definition

type Factory

type Factory struct{}

Factory implements the ClientFactory interface for Supabase

func NewFactory

func NewFactory() *Factory

NewFactory creates a new Supabase factory

func (*Factory) CreateClient

func (f *Factory) CreateClient(config *vectordb.Config) (vectordb.VectorDBClient, error)

CreateClient creates a new Supabase client

func (*Factory) GetSupportedTypes

func (f *Factory) GetSupportedTypes() []vectordb.VectorDBType

GetSupportedTypes returns the list of supported database types

func (*Factory) ValidateConfig

func (f *Factory) ValidateConfig(config *vectordb.Config) error

ValidateConfig validates the configuration for Supabase

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL