Documentation
¶
Overview ¶
Package sqlite provides SQLite-backed persistent storage for ToolHive.
Index ¶
- func DefaultDBPath() string
- func NewDefaultSkillStore() (storage.SkillStore, error)
- type DB
- type SkillStore
- func (s *SkillStore) Close() error
- func (s *SkillStore) Create(ctx context.Context, skill skills.InstalledSkill) error
- func (s *SkillStore) Delete(ctx context.Context, name string, scope skills.Scope, projectRoot string) error
- func (s *SkillStore) Get(ctx context.Context, name string, scope skills.Scope, projectRoot string) (skills.InstalledSkill, error)
- func (s *SkillStore) List(ctx context.Context, filter storage.ListFilter) ([]skills.InstalledSkill, error)
- func (s *SkillStore) Update(ctx context.Context, skill skills.InstalledSkill) error
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.
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 ¶
func (s *SkillStore) List(ctx context.Context, filter storage.ListFilter) ([]skills.InstalledSkill, error)
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.