db

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Open

func Open(dbPath string) (*sql.DB, error)

Types

type HistoryEntry

type HistoryEntry struct {
	ID        int64
	TsMs      int64 //nolint:staticcheck // TsMs is clearer than TSMs
	Duration  int64
	ExitCode  int
	Command   string
	Directory string
	SessionID string
	Hostname  string
}

type HistoryRepo

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

func NewHistoryRepo

func NewHistoryRepo(db *sql.DB) *HistoryRepo

func (*HistoryRepo) Delete

func (r *HistoryRepo) Delete(id int64) error

func (*HistoryRepo) FetchCandidates

func (r *HistoryRepo) FetchCandidates(limit int, dedupe bool, onlyFails bool) ([]HistoryEntry, error)

func (*HistoryRepo) Insert

func (r *HistoryRepo) Insert(entry HistoryEntry) (int64, error)

func (*HistoryRepo) Recent

func (r *HistoryRepo) Recent(limit int) ([]HistoryEntry, error)

func (*HistoryRepo) RecentInDir

func (r *HistoryRepo) RecentInDir(dir string, limit int) ([]HistoryEntry, error)

Jump to

Keyboard shortcuts

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