db

package
v0.0.0-...-ceb87d2 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package db provides functions for accessing and talking to the goals db.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect() (err error)

Connect connects to a local database using sqlite3 drives

func Disconnect

func Disconnect()

Disconnect disconnects from the local database

func FetchGoalsAndProgress

func FetchGoalsAndProgress() (*[]models.Goal, error)

FetchGoalsAndProgress fetches all goals and progresses from local database

func InsertGoal

func InsertGoal(goal *models.Goal) error

InsertGoal inserts a new goal and its progresses into local database and updates goal fields like ID, and Progress[].ID

func InsertProgress

func InsertProgress(p *models.Progress, g *models.Goal) error

InsertProgress inserts a new progress into local database and updates progress field ID to match the one in the database

func RemoveGoal

func RemoveGoal(goalID int64) error

RemoveGoal removes a goal identified by the parameter goalID from the database.

func RemoveProgress

func RemoveProgress(progressID int64) error

RemoveProgress removes a progress identified by progressID from the database.

func UpdateGoalNoProgress

func UpdateGoalNoProgress(g *models.Goal) error

UpdateGoalNoProgress updates goal info in the database without modifying any of its progresses

func UpdateProgress

func UpdateProgress(p *models.Progress) error

UpdateProgress Updates progress info into the database

Types

This section is empty.

Jump to

Keyboard shortcuts

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