type URI struct {
Variant Variant
Resource string // table, store, or bucket name
Key string // record key or blob path
}
func ParseURI(raw string) (*URI, error)
func (u *URI) String() string
func (u *URI) ResourceURI() string
Resource
type Resource struct {
URI string
Variant Variant
Name string
Spec atom.Spec
Metadata Metadata
}
Metadata
type Metadata struct {
Description string
Version string
Tags map[string]string
}
Scio
Constructor
func New() *Scio
Registration
func (s *Scio) RegisterDatabase(uri string, db grub.AtomicDatabase, opts ...RegistrationOption) error
func (s *Scio) RegisterStore(uri string, store grub.AtomicStore, opts ...RegistrationOption) error
func (s *Scio) RegisterBucket(uri string, bucket grub.AtomicBucket, opts ...RegistrationOption) error
func (s *Scio) RegisterIndex(uri string, index grub.AtomicIndex, opts ...RegistrationOption) error
// Common operations
func (s *Scio) Get(ctx context.Context, uri string) (*atom.Atom, error)
func (s *Scio) Set(ctx context.Context, uri string, data *atom.Atom) error
func (s *Scio) Delete(ctx context.Context, uri string) error
func (s *Scio) Exists(ctx context.Context, uri string) (bool, error)
// Database operations
func (s *Scio) Query(ctx context.Context, uri string, stmt edamame.QueryStatement, params map[string]any) ([]*atom.Atom, error)
func (s *Scio) Select(ctx context.Context, uri string, stmt edamame.SelectStatement, params map[string]any) (*atom.Atom, error)
// Store operations
func (s *Scio) SetWithTTL(ctx context.Context, uri string, data *atom.Atom, ttl time.Duration) error
// Bucket operations
func (s *Scio) Put(ctx context.Context, uri string, obj *grub.AtomicObject) error
// Index operations
func (s *Scio) GetVector(ctx context.Context, uri string) (*grub.AtomicVector, error)
func (s *Scio) UpsertVector(ctx context.Context, uri string, vector []float32, metadata *atom.Atom) error
func (s *Scio) DeleteVector(ctx context.Context, uri string) error
func (s *Scio) VectorExists(ctx context.Context, uri string) (bool, error)
func (s *Scio) SearchVectors(ctx context.Context, uri string, vector []float32, k int, filter *atom.Atom) ([]grub.AtomicVector, error)
func (s *Scio) QueryVectors(ctx context.Context, uri string, vector []float32, k int, filter *vecna.Filter) ([]grub.AtomicVector, error)
func (s *Scio) FilterVectors(ctx context.Context, uri string, filter *vecna.Filter, limit int) ([]grub.AtomicVector, error)
Catalog
// Topology queries
func (s *Scio) Sources() []Resource
func (s *Scio) Databases() []Resource
func (s *Scio) Stores() []Resource
func (s *Scio) Buckets() []Resource
func (s *Scio) Indexes() []Resource
// Spec queries
func (s *Scio) Spec(uri string) (atom.Spec, error)
func (s *Scio) FindBySpec(spec atom.Spec) []Resource
func (s *Scio) FindByField(field string) []Resource
func (s *Scio) Related(uri string) []Resource
// Resource lookup
func (s *Scio) Resource(uri string) *Resource
Errors
// scio errors
var ErrInvalidURI = errors.New("invalid URI")
var ErrUnknownVariant = errors.New("unknown variant")
var ErrResourceNotFound = errors.New("resource not found")
var ErrResourceExists = errors.New("resource already exists")
var ErrVariantMismatch = errors.New("variant mismatch")
var ErrKeyRequired = errors.New("key required")
var ErrKeyNotExpected = errors.New("key not expected")
var ErrInvalidUUID = errors.New("invalid UUID")
// Re-exported from grub
var ErrNotFound = grub.ErrNotFound
var ErrDuplicate = grub.ErrDuplicate
var ErrConflict = grub.ErrConflict
var ErrConstraint = grub.ErrConstraint
var ErrInvalidKey = grub.ErrInvalidKey
var ErrReadOnly = grub.ErrReadOnly
var ErrTTLNotSupported = grub.ErrTTLNotSupported