sqldb

package
v0.0.0-...-8897277 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package sqldb implements the server.DB interface, backed by a sqlite database.

Index

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 New

func New(dbPath, migrationsPath string) (*DB, error)

func (*DB) Close

func (db *DB) Close() error

func (*DB) ComparableLifts

func (db *DB) ComparableLifts(ex stronk.Exercise, weight stronk.Weight) (*stronk.ComparableLifts, error)

func (*DB) CreateExercise

func (db *DB) CreateExercise(ex stronk.Exercise) error

func (*DB) EditLift

func (db *DB) EditLift(id stronk.LiftID, note string, reps int) error

func (*DB) Lift

func (db *DB) Lift(id stronk.LiftID) (*stronk.Lift, error)

func (*DB) RecentFailureSets

func (db *DB) RecentFailureSets() ([]*stronk.Lift, error)

func (*DB) RecentLifts

func (db *DB) RecentLifts() ([]*stronk.Lift, error)

func (*DB) RecordLift

func (db *DB) RecordLift(ex stronk.Exercise, st stronk.SetType, weight stronk.Weight, set int, reps int, note string, day, week, iter int, toFailure bool) (stronk.LiftID, error)

func (*DB) SetSmallestDenom

func (db *DB) SetSmallestDenom(small stronk.Weight) error

func (*DB) SetTrainingMaxes

func (db *DB) SetTrainingMaxes(press, squat, bench, deadlift stronk.Weight) error

func (*DB) SkipWeek

func (db *DB) SkipWeek(note string, week, iter int) error

func (*DB) SkippedWeeks

func (db *DB) SkippedWeeks() ([]stronk.SkippedWeek, error)

func (*DB) SmallestDenom

func (db *DB) SmallestDenom() (stronk.Weight, error)

func (*DB) TrainingMaxes

func (db *DB) TrainingMaxes() ([]*stronk.TrainingMax, error)

Jump to

Keyboard shortcuts

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