Documentation
¶
Overview ¶
Package sqldb implements the server.DB interface, backed by a sqlite database.
Index ¶
- type DB
- func (db *DB) Close() error
- func (db *DB) ComparableLifts(ex stronk.Exercise, weight stronk.Weight) (*stronk.ComparableLifts, error)
- func (db *DB) CreateExercise(ex stronk.Exercise) error
- func (db *DB) EditLift(id stronk.LiftID, note string, reps int) error
- func (db *DB) GetCurrentRoutine() (*stronk.StoredRoutine, error)
- func (db *DB) GetRoutineSet(id stronk.RoutineSetID) (*stronk.StoredRoutineSet, error)
- func (db *DB) LatestLift() (*stronk.Lift, error)
- func (db *DB) LatestLiftPerSetID(setIDs []stronk.RoutineSetID) (map[stronk.RoutineSetID]*stronk.Lift, error)
- func (db *DB) Lift(id stronk.LiftID) (*stronk.Lift, error)
- func (db *DB) MigrateLiftsToNewFormat(storedRoutine *stronk.StoredRoutine) error
- func (db *DB) RecentFailureSets() ([]*stronk.Lift, error)
- func (db *DB) RecentLifts() ([]*stronk.Lift, error)
- func (db *DB) RecordLift(routineSetID stronk.RoutineSetID, reps int, note string, weight stronk.Weight) (stronk.LiftID, error)
- func (db *DB) SetSmallestDenom(small stronk.Weight) error
- func (db *DB) SetTrainingMaxes(press, squat, bench, deadlift stronk.Weight) error
- func (db *DB) SkipWeek(note string, week, iter int) error
- func (db *DB) SkippedWeeks() ([]stronk.SkippedWeek, error)
- func (db *DB) SmallestDenom() (stronk.Weight, error)
- func (db *DB) StoreRoutine(routine *stronk.Routine) (*stronk.StoredRoutine, error)
- func (db *DB) TrainingMaxes() ([]*stronk.TrainingMax, error)
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
}
func (*DB) ComparableLifts ¶
func (*DB) GetCurrentRoutine ¶
func (db *DB) GetCurrentRoutine() (*stronk.StoredRoutine, error)
GetCurrentRoutine returns the most recently stored routine.
func (*DB) GetRoutineSet ¶
func (db *DB) GetRoutineSet(id stronk.RoutineSetID) (*stronk.StoredRoutineSet, error)
GetRoutineSet gets a specific routine set by ID
func (*DB) LatestLiftPerSetID ¶
func (db *DB) LatestLiftPerSetID(setIDs []stronk.RoutineSetID) (map[stronk.RoutineSetID]*stronk.Lift, error)
func (*DB) MigrateLiftsToNewFormat ¶
func (db *DB) MigrateLiftsToNewFormat(storedRoutine *stronk.StoredRoutine) error
MigrateLiftsToNewFormat migrates existing lifts from the old format to the new one This should be called after storing the routine in the database
func (*DB) RecordLift ¶
func (db *DB) RecordLift(routineSetID stronk.RoutineSetID, reps int, note string, weight stronk.Weight) (stronk.LiftID, error)
RecordLift records a lift using the new routine system
func (*DB) SetTrainingMaxes ¶
func (*DB) SkippedWeeks ¶
func (db *DB) SkippedWeeks() ([]stronk.SkippedWeek, error)
func (*DB) StoreRoutine ¶
StoreRoutine stores a new routine in the database
func (*DB) TrainingMaxes ¶
func (db *DB) TrainingMaxes() ([]*stronk.TrainingMax, error)
Click to show internal directories.
Click to hide internal directories.