Documentation ¶
Overview ¶
Package db provides functions for accessing and talking to the goals db.
Index ¶
- func Connect() (err error)
- func Disconnect()
- func FetchGoalsAndProgress() (*[]models.Goal, error)
- func InsertGoal(goal *models.Goal) error
- func InsertProgress(p *models.Progress, g *models.Goal) error
- func RemoveGoal(goalID int64) error
- func RemoveProgress(progressID int64) error
- func UpdateGoalNoProgress(g *models.Goal) error
- func UpdateProgress(p *models.Progress) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FetchGoalsAndProgress ¶
FetchGoalsAndProgress fetches all goals and progresses from local database
func InsertGoal ¶
InsertGoal inserts a new goal and its progresses into local database and updates goal fields like ID, and Progress[].ID
func InsertProgress ¶
InsertProgress inserts a new progress into local database and updates progress field ID to match the one in the database
func RemoveGoal ¶
RemoveGoal removes a goal identified by the parameter goalID from the database.
func RemoveProgress ¶
RemoveProgress removes a progress identified by progressID from the database.
func UpdateGoalNoProgress ¶
UpdateGoalNoProgress updates goal info in the database without modifying any of its progresses
func UpdateProgress ¶
UpdateProgress Updates progress info into the database
Types ¶
This section is empty.