sqlite

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

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

Storage implements learning.Storage for SQLite

func New

func New(dbPath string) (*Storage, error)

New creates a new SQLite storage for learning

func (*Storage) Close

func (s *Storage) Close() error

Close closes the database connection

func (*Storage) DeleteUserData

func (s *Storage) DeleteUserData(ctx context.Context, userID string) error

DeleteUserData deletes all data for a user (GDPR compliance)

func (*Storage) DeleteUserMemories

func (s *Storage) DeleteUserMemories(ctx context.Context, userID string) error

DeleteUserMemories deletes all memories for a user

func (*Storage) GetKnowledge

func (s *Storage) GetKnowledge(ctx context.Context, topic string, limit int) ([]learning.Knowledge, error)

GetKnowledge retrieves knowledge by topic

func (*Storage) GetLearningEvents

func (s *Storage) GetLearningEvents(ctx context.Context, userID string, limit int) ([]learning.LearningEvent, error)

GetLearningEvents retrieves learning events for a user

func (*Storage) GetUserMemories

func (s *Storage) GetUserMemories(ctx context.Context, userID string, limit int) ([]learning.UserMemory, error)

GetUserMemories retrieves user memories

func (*Storage) GetUserProfile

func (s *Storage) GetUserProfile(ctx context.Context, userID string) (*learning.UserProfile, error)

GetUserProfile retrieves a user profile

func (*Storage) SaveKnowledge

func (s *Storage) SaveKnowledge(ctx context.Context, knowledge *learning.Knowledge) error

SaveKnowledge saves learned knowledge

func (*Storage) SaveLearningEvent

func (s *Storage) SaveLearningEvent(ctx context.Context, event *learning.LearningEvent) error

SaveLearningEvent saves a learning event

func (*Storage) SaveUserMemory

func (s *Storage) SaveUserMemory(ctx context.Context, memory *learning.UserMemory) error

SaveUserMemory saves a user memory

func (*Storage) SaveUserProfile

func (s *Storage) SaveUserProfile(ctx context.Context, profile *learning.UserProfile) error

SaveUserProfile saves or updates a user profile

func (*Storage) SearchKnowledge

func (s *Storage) SearchKnowledge(ctx context.Context, query string, limit int) ([]learning.Knowledge, error)

SearchKnowledge searches knowledge by content

Jump to

Keyboard shortcuts

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