Documentation
¶
Index ¶
- type DB
- func (db *DB) BeginTx() (*sql.Tx, error)
- func (db *DB) Close() error
- func (db *DB) DeleteToolUsesForSessionTx(tx *sql.Tx, sessionID string) error
- func (db *DB) DeleteTurnsForSession(sessionID string) error
- func (db *DB) DeleteTurnsForSessionTx(tx *sql.Tx, sessionID string) error
- func (db *DB) GetAllSourceMtimes() (map[string]time.Time, error)
- func (db *DB) GetFirstAndLastActivity() (first, last time.Time, err error)
- func (db *DB) GetProject(id int64) (*models.Project, error)
- func (db *DB) GetProjectByPath(path string) (*models.Project, error)
- func (db *DB) GetProjectStats() (count int, totalTokens int64, err error)
- func (db *DB) GetProjects(orderBy string, limit int) ([]models.Project, error)
- func (db *DB) GetSession(id string) (*models.Session, error)
- func (db *DB) GetSessionBySourceFile(path string) (*models.Session, error)
- func (db *DB) GetSessionStats() (count int, totalTurns int, totalTokens int64, err error)
- func (db *DB) GetSessions(projectID int64, limit int) ([]models.Session, error)
- func (db *DB) GetSourceMtime(path string) (time.Time, error)
- func (db *DB) GetTokensByModel() (map[string]int64, error)
- func (db *DB) GetToolUsageStats(limit int) (map[string]int, error)
- func (db *DB) GetTurnCount() (int, error)
- func (db *DB) GetTurns(sessionID string) ([]models.Turn, error)
- func (db *DB) InsertToolUses(toolUses []models.ToolUse) error
- func (db *DB) InsertToolUsesTx(tx *sql.Tx, toolUses []models.ToolUse) error
- func (db *DB) InsertTurns(turns []models.Turn) error
- func (db *DB) InsertTurnsTx(tx *sql.Tx, turns []models.Turn) error
- func (db *DB) Path() string
- func (db *DB) SearchTurns(query string, limit int) ([]models.Turn, error)
- func (db *DB) SearchTurnsWithFilters(textQuery string, projectID int64, model string, toolName string, limit int) ([]models.Turn, error)
- func (db *DB) UpdateProjectStats(projectID int64) error
- func (db *DB) UpsertProject(p *models.Project) error
- func (db *DB) UpsertProjectTx(tx *sql.Tx, p *models.Project) error
- func (db *DB) UpsertSession(s *models.Session) error
- func (db *DB) UpsertSessionTx(tx *sql.Tx, s *models.Session) error
- func (db *DB) UpsertSourceFileMtime(path string, mtime time.Time) error
- func (db *DB) UpsertSourceFileMtimeTx(tx *sql.Tx, path string, mtime time.Time) error
- func (db *DB) WithTx(fn func(*sql.Tx) error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
DB wraps the SQLite database connection
func (*DB) DeleteToolUsesForSessionTx ¶
DeleteToolUsesForSession removes tool uses for a session
func (*DB) DeleteTurnsForSession ¶
DeleteTurnsForSession removes all turns for a session (for re-sync)
func (*DB) DeleteTurnsForSessionTx ¶
DeleteTurnsForSessionTx removes all turns for a session within a transaction
func (*DB) GetAllSourceMtimes ¶
GetAllSourceMtimes loads all source file modification times from the source_files tracking table
func (*DB) GetFirstAndLastActivity ¶
GetFirstAndLastActivity returns the date range of all activity
func (*DB) GetProject ¶
GetProject retrieves a project by ID
func (*DB) GetProjectByPath ¶
GetProjectByPath retrieves a project by path
func (*DB) GetProjectStats ¶
GetProjectStats returns aggregate statistics for projects
func (*DB) GetProjects ¶
GetProjects retrieves all projects
func (*DB) GetSession ¶
GetSession retrieves a session by ID
func (*DB) GetSessionBySourceFile ¶
GetSessionBySourceFile retrieves a session by its source file path
func (*DB) GetSessionStats ¶
GetSessionStats returns aggregate statistics for sessions
func (*DB) GetSessions ¶
GetSessions retrieves sessions with optional filters
func (*DB) GetSourceMtime ¶
GetSourceMtime retrieves the last sync time for a source file
func (*DB) GetTokensByModel ¶
GetTokensByModel returns token usage grouped by model
func (*DB) GetToolUsageStats ¶
GetToolUsageStats returns tool usage counts
func (*DB) GetTurnCount ¶
GetTurnCount returns total number of turns
func (*DB) InsertToolUses ¶
InsertToolUses inserts tool usage records
func (*DB) InsertToolUsesTx ¶
InsertToolUsesTx inserts tool usage records within a transaction
func (*DB) InsertTurns ¶
InsertTurns inserts multiple turns in a batch
func (*DB) InsertTurnsTx ¶
InsertTurnsTx inserts multiple turns within a transaction
func (*DB) SearchTurns ¶
SearchTurns performs full-text search on turn content
func (*DB) SearchTurnsWithFilters ¶
func (db *DB) SearchTurnsWithFilters(textQuery string, projectID int64, model string, toolName string, limit int) ([]models.Turn, error)
SearchTurnsWithFilters performs filtered search
func (*DB) UpdateProjectStats ¶
UpdateProjectStats recalculates project statistics from sessions
func (*DB) UpsertProject ¶
UpsertProject creates or updates a project record
func (*DB) UpsertProjectTx ¶
UpsertProjectTx creates or updates a project record within a transaction
func (*DB) UpsertSession ¶
UpsertSession creates or updates a session record
func (*DB) UpsertSessionTx ¶
UpsertSessionTx creates or updates a session record within a transaction
func (*DB) UpsertSourceFileMtime ¶
UpsertSourceFileMtime records a source file's mtime after processing
func (*DB) UpsertSourceFileMtimeTx ¶
UpsertSourceFileMtimeTx records a source file's mtime within a transaction