dbplayer

package
v0.0.0-...-8bbd0fc Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2020 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const STATUS_ACTIVE = "active"
View Source
const STATUS_INACTIVE = "inactive"

Variables

This section is empty.

Functions

func Delete

func Delete(d *Player) error

Delete deletes a record from the database

func Insert

func Insert(d *Player) error

Insert will create a new record in the database

func Save

func Save(s *Player) error

func Update

func Update(s *Player) error

Update will update a record in the database

Types

type Player

type Player struct {
	PlayerID     int64               `db:"player_id"`
	SportLevelID int64               `db:"sport_level_id"`
	TeamID       database.NullInt64  `db:"team_id"`
	PositionID   database.NullInt64  `db:"position_id"`
	FirstName    database.NullString `db:"first_name"`
	LastName     database.NullString `db:"last_name"`
	Status       string              `db:"status"`
	StatsKey     database.NullString `db:"stats_key"`
	Weight       database.NullInt64  `db:"weight"`
	Height       database.NullInt64  `db:"height"`
	Jersey       database.NullInt64  `db:"jersey"`
	Year         database.NullInt64  `db:"year"`
	HomeCity     database.NullString `db:"home_city"`
	HomeState    database.NullString `db:"home_state"`
	HomeCountry  database.NullString `db:"home_country"`
}

func ReadAll

func ReadAll() ([]Player, error)

ReadAll reads all records in the database

func ReadByID

func ReadByID(ID int64) (*Player, error)

ReadByID reads by id column

func ReadByStatsKeyAndSportLevel

func ReadByStatsKeyAndSportLevel(statsKey string, sportLevelId int64) (*Player, error)

ReadByStatsKeyAndSportLevel reads by stats_key and sport_level_id columns

Jump to

Keyboard shortcuts

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