store

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package store provides SQLite-backed storage primitives for Stroma indexes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckSQLiteReady

func CheckSQLiteReady() error

CheckSQLiteReady validates that the SQLite driver and sqlite-vec extension are usable.

func CheckSQLiteReadyContext

func CheckSQLiteReadyContext(ctx context.Context) error

CheckSQLiteReadyContext validates that the SQLite driver and sqlite-vec extension are usable.

func CosineScoreFromDistance

func CosineScoreFromDistance(distance float64) float64

CosineScoreFromDistance converts sqlite-vec cosine distance into a clamped score.

func DecodeVectorBlob

func DecodeVectorBlob(blob []byte) ([]float64, error)

DecodeVectorBlob decodes a sqlite-vec float32 blob into float64 values.

func EncodeVectorBlob

func EncodeVectorBlob(vector []float64) ([]byte, error)

EncodeVectorBlob encodes float64 embeddings into the sqlite-vec blob format.

func IsMissingIndex

func IsMissingIndex(err error) bool

IsMissingIndex reports whether err wraps a missing-index failure.

func MissingIndexPath

func MissingIndexPath(err error) string

MissingIndexPath returns the configured path for a missing-index failure.

func OpenReadOnly

func OpenReadOnly(path string) (*sql.DB, error)

OpenReadOnly opens a fresh read-only SQLite handle.

func OpenReadOnlyContext

func OpenReadOnlyContext(ctx context.Context, path string) (*sql.DB, error)

OpenReadOnlyContext opens a fresh read-only SQLite handle.

func OpenReadWrite

func OpenReadWrite(path string) (*sql.DB, error)

OpenReadWrite opens a read-write SQLite handle.

func OpenReadWriteContext

func OpenReadWriteContext(ctx context.Context, path string) (*sql.DB, error)

OpenReadWriteContext opens a read-write SQLite handle.

Types

type MissingIndexError

type MissingIndexError struct {
	Path string
}

MissingIndexError reports that the requested index file does not exist yet.

func (*MissingIndexError) Error

func (e *MissingIndexError) Error() string

Jump to

Keyboard shortcuts

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