db

package
v0.0.0-...-885995f Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const SelectStatement = "SELECT taskID, title, done FROM Task WHERE done = ?"

Variables

View Source
var FileCreate = os.Create

Functions

func CreateTaskTable

func CreateTaskTable(db SQLDB)

func SQLExec

func SQLExec(sqlStatement string, db SQLDB) error

Types

type FileCreatorHelper

type FileCreatorHelper struct{}

type SQLDB

type SQLDB interface {
	Exec(query string, args ...interface{}) (sql.Result, error)
	Query(query string, args ...interface{}) (rowScanner, error)
	Close() error
}

func CreateSQLiteDB

func CreateSQLiteDB(filepath string, fc fileCreator) SQLDB

func DBOpen

func DBOpen(filepath string) SQLDB

type TaskStruct

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

func GetTasks

func GetTasks(db SQLDB, done bool) []TaskStruct

Use struct for return val instead

Jump to

Keyboard shortcuts

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