db

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2026 License: 0BSD Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Activity

type Activity struct {
	ID               int64
	ClientID         string
	Project          string
	GitRemote        string
	StartedAt        time.Time
	EndedAt          time.Time
	Filename         string
	Filetype         string
	LinesAdded       int
	LinesRemoved     int
	GitBranch        string
	ActionsPerMinute float64
	WordsPerMinute   float64
	Editor           string
	Machine          string
	Synced           bool
	CreatedAt        time.Time
}

type DB

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

func Open

func Open(path string) (*DB, error)

func (*DB) Close

func (db *DB) Close() error

func (*DB) GetStats

func (db *DB) GetStats() (*Stats, error)

GetStats returns total and unsynced activity counts.

func (*DB) GetUnsyncedActivities

func (db *DB) GetUnsyncedActivities(limit int) (activities []*Activity, err error)

func (*DB) InsertActivity

func (db *DB) InsertActivity(a *Activity) error

func (*DB) MarkSynced

func (db *DB) MarkSynced(ids []int64) (err error)

type Stats

type Stats struct {
	Total    int64
	Unsynced int64
}

Stats holds aggregate counts from the activities table.

Jump to

Keyboard shortcuts

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