sqlite

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

DB represents the SQLite database connection

func New

func New(dsn string) (*DB, error)

New creates a new database connection

func (*DB) AddMessage

func (db *DB) AddMessage(sessionID string, message *pkg.Message) error

AddMessage adds a message to a session

func (*DB) Close

func (db *DB) Close() error

Close closes the database connection

func (*DB) CreateSession

func (db *DB) CreateSession(session *pkg.Session) error

CreateSession creates a new session

func (*DB) DeleteSession

func (db *DB) DeleteSession(id string) error

DeleteSession deletes a session and all related data

func (*DB) GetSession

func (db *DB) GetSession(id string) (*pkg.Session, error)

GetSession retrieves a session by ID

func (*DB) GetSessionMessages

func (db *DB) GetSessionMessages(sessionID string) ([]pkg.Message, error)

GetSessionMessages retrieves all messages for a session

func (*DB) GetSetting

func (db *DB) GetSetting(key string) (string, error)

GetSetting retrieves a setting value

func (*DB) GetWorkspaceMetadata

func (db *DB) GetWorkspaceMetadata(projectPath string) (*pkg.ProjectContext, error)

GetWorkspaceMetadata retrieves workspace analysis for a path

func (*DB) ListSessions

func (db *DB) ListSessions(limit int) ([]*pkg.Session, error)

ListSessions returns all sessions ordered by updated_at

func (*DB) LogToolExecution

func (db *DB) LogToolExecution(sessionID, messageID, toolName string, input map[string]interface{}, output string, exitCode int, duration time.Duration) error

LogToolExecution records a tool execution for audit

func (*DB) SaveWorkspaceMetadata

func (db *DB) SaveWorkspaceMetadata(ctx *pkg.ProjectContext) error

SaveWorkspaceMetadata saves or updates workspace analysis

func (*DB) SetSetting

func (db *DB) SetSetting(key, value string) error

SetSetting saves a setting value

func (*DB) UpdateSession

func (db *DB) UpdateSession(session *pkg.Session) error

UpdateSession updates a session

Jump to

Keyboard shortcuts

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