sqlitestore

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: May 3, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*options)

Option is a functional option for configuring SQLiteStore.

func WithAutoHitCounting

func WithAutoHitCounting(enabled bool) Option

WithAutoHitCounting controls whether queries automatically increment HitCount and LastHit. Enabled by default; pass false to disable.

func WithConfiguredScopes

func WithConfiguredScopes(scopes []store.Scope) Option

WithConfiguredScopes sets the allowed (or default) scopes for query methods. When set, queries which don't specify scopes will default to these, while queries providing scopes must be a subset of this set. This applies to reads/queries. Writes (e.g. Upsert and Promote) are not constrained.

type SQLiteStore

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

func New

func New(path string, logger *slog.Logger, opts ...Option) (*SQLiteStore, error)

func (*SQLiteStore) All

func (s *SQLiteStore) All(scopes []store.Scope) ([]store.Entry, error)

func (*SQLiteStore) AllByCategory

func (s *SQLiteStore) AllByCategory(category string, topK int, scopes []store.Scope) ([]store.Entry, error)

func (*SQLiteStore) Close

func (s *SQLiteStore) Close() error

func (*SQLiteStore) Delete

func (s *SQLiteStore) Delete(id string) error

func (*SQLiteStore) Get

func (s *SQLiteStore) Get(id string) (*store.Entry, error)

func (*SQLiteStore) ListHeads

func (s *SQLiteStore) ListHeads(scopes []store.Scope) ([]store.HeadInfo, error)

func (*SQLiteStore) Promote

func (s *SQLiteStore) Promote(id string, targetScope store.Scope) error

func (*SQLiteStore) Query

func (s *SQLiteStore) Query(category string, tags []string) ([]store.Entry, error)

func (*SQLiteStore) QueryByCategory

func (s *SQLiteStore) QueryByCategory(category, query string, topK int, scopes []store.Scope) ([]store.Entry, error)

func (*SQLiteStore) Score

func (s *SQLiteStore) Score(id string, delta float64) error

func (*SQLiteStore) Upsert

func (s *SQLiteStore) Upsert(entry *store.Entry) error

Jump to

Keyboard shortcuts

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