list

package
v0.0.0-...-9f32554 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteList

func DeleteList(dbc *sqlx.DB, id int) error

DeleteList deletes a row in the list table based off of list_id.

func UpdateList

func UpdateList(dbc *sqlx.DB, r List) error

UpdateList updates a row in the list table based off of a list_id. The only field able to be updated is the name field.

Types

type List

type List struct {
	ID       int       `json:"id" db:"list_id"`
	Name     string    `json:"name" db:"name"`
	Created  time.Time `json:"created" db:"created"`
	Modified time.Time `json:"modified" db:"modified"`
}

List is a type that contains the proper struct tags for both a JSON and Postgres representation of a list.

func CreateList

func CreateList(dbc *sqlx.DB, r List) (List, error)

CreateList inserts a new row into the list table.

func SelectList

func SelectList(dbc *sqlx.DB, id int) (List, error)

SelectList selects a single row from the list table based off of a given list_id.

func SelectLists

func SelectLists(dbc *sqlx.DB) ([]List, error)

SelectLists selects all rows from the list table.

Jump to

Keyboard shortcuts

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