sqlite

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package sqlite provides SQLite-backed persistent storage for ToolHive.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultDBPath

func DefaultDBPath() string

DefaultDBPath returns the default file path for the ToolHive SQLite database, located under the XDG state directory.

func NewDefaultSkillStore

func NewDefaultSkillStore() (storage.SkillStore, error)

NewDefaultSkillStore creates a SkillStore using OS environment for runtime detection. In Kubernetes it returns a NoopSkillStore; locally it opens a SQLite database at the default path. The caller owns the returned store.

Types

type DB

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

DB wraps a *sql.DB connection to a SQLite database.

func Open

func Open(ctx context.Context, dbPath string) (_ *DB, err error)

Open opens (or creates) a SQLite database at the given path. It ensures the parent directory exists, configures recommended PRAGMAs for WAL mode, runs any pending migrations, and verifies the connection before returning.

func (*DB) Close

func (d *DB) Close() error

Close closes the underlying database connection.

func (*DB) DB

func (d *DB) DB() *sql.DB

DB returns the underlying *sql.DB for use by store implementations.

type SkillStore

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

SkillStore implements storage.SkillStore using SQLite.

func NewSkillStore

func NewSkillStore(db *DB) *SkillStore

NewSkillStore creates a new SQLite-backed SkillStore.

func (*SkillStore) Close

func (s *SkillStore) Close() error

Close closes the underlying database connection.

func (*SkillStore) Create

func (s *SkillStore) Create(ctx context.Context, skill skills.InstalledSkill) error

Create stores a new installed skill.

func (*SkillStore) Delete

func (s *SkillStore) Delete(ctx context.Context, name string, scope skills.Scope, projectRoot string) error

Delete removes an installed skill by name, scope, and project root.

func (*SkillStore) Get

func (s *SkillStore) Get(
	ctx context.Context, name string, scope skills.Scope, projectRoot string,
) (skills.InstalledSkill, error)

Get retrieves an installed skill by name, scope, and project root.

func (*SkillStore) List

List returns all installed skills matching the given filter.

func (*SkillStore) Update

func (s *SkillStore) Update(ctx context.Context, skill skills.InstalledSkill) error

Update modifies an existing installed skill.

Jump to

Keyboard shortcuts

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