Documentation
¶
Index ¶
- func GetDBPath() (string, error)
- type DB
- func (db *DB) AddHistoryEntry(prompt string, response *model.CommandResponse, usage *model.LLMUsage, ...) (int64, error)
- func (db *DB) Close() error
- func (db *DB) DeleteHistoryEntry(id int64) error
- func (db *DB) GetHistoryEntries(limit int, offset int, onlyFavorites bool, searchTerm string) ([]model.HistoryEntry, error)
- func (db *DB) GetHistoryEntry(id int64) (*model.HistoryEntry, error)
- func (db *DB) GetMostRecentSuccessfulCommand() (*model.HistoryEntry, error)
- func (db *DB) InitSchema() error
- func (db *DB) SearchHistory(query string, limit int) ([]model.HistoryEntry, error)
- func (db *DB) SetFavorite(id int64, favorite bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB handles database operations
func (*DB) AddHistoryEntry ¶
func (db *DB) AddHistoryEntry( prompt string, response *model.CommandResponse, usage *model.LLMUsage, errorMsg string, parentID sql.NullInt64, ) (int64, error)
AddHistoryEntry adds a new entry to the command history
func (*DB) DeleteHistoryEntry ¶
DeleteHistoryEntry deletes a history entry by ID
func (*DB) GetHistoryEntries ¶
func (db *DB) GetHistoryEntries(limit int, offset int, onlyFavorites bool, searchTerm string) ([]model.HistoryEntry, error)
GetHistoryEntries retrieves entries from the command history with optional filtering
func (*DB) GetHistoryEntry ¶
func (db *DB) GetHistoryEntry(id int64) (*model.HistoryEntry, error)
GetHistoryEntry retrieves a single history entry by ID
func (*DB) GetMostRecentSuccessfulCommand ¶
func (db *DB) GetMostRecentSuccessfulCommand() (*model.HistoryEntry, error)
GetMostRecentSuccessfulCommand returns the last successful command
func (*DB) SearchHistory ¶
SearchHistory searches through history entries
Click to show internal directories.
Click to hide internal directories.