games

package
v0.0.0-...-4c63195 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const TableName = "games"

TableName is the primary table that this particular gnormed file deals with.

Variables

View Source
var (
	BoxArtURLCol models.StringField   = "box_art_url"
	CreatedAtCol models.TimeTimeField = "created_at"
	IDCol        models.IntField      = "id"
	NameCol      models.StringField   = "name"
	UpdatedAtCol models.TimeTimeField = "updated_at"
)

Field values for every column in Games.

Functions

func AppendInt64

func AppendInt64(ctx context.Context, db models.DB, name string, value interface{}, where models.WhereClause) (int64, error)

AppendInt64 adds a value to a field

func CountQuery

func CountQuery(ctx context.Context, db models.DB, where models.WhereClause) (int, error)

CountQuery retrieve one row from 'games'.

func Delete

func Delete(ctx context.Context,
	db models.DB,
	id int,
) (int64, error)

Delete deletes the Row from the database. Returns the number of items deleted.

func DeleteAll

func DeleteAll(ctx context.Context, db models.DB) (int64, error)

DeleteAll deletes all Rows from the database and returns the number of rows deleted.

func DeleteWhere

func DeleteWhere(ctx context.Context, db models.DB, where models.WhereClause) (int64, error)

DeleteWhere deletes Rows from the database and returns the number of rows deleted.

func Inc

func Inc(ctx context.Context, db models.DB, inc models.Where, where models.WhereClause) (int64, error)

Inc increments the value of a single column on an existing row in the database.

func Insert

func Insert(ctx context.Context, db models.DB, r *Row) error

Insert inserts the row into the database.

func InsertIgnore

func InsertIgnore(ctx context.Context, db models.DB, r *Row, constraint string) error

InsertIgnore inserts the row into the database but ignores conflicts

func Set

func Set(ctx context.Context, db models.DB, set models.Where, where models.WhereClause) (int64, error)

Set sets a single column on an existing row in the database.

func Update

func Update(ctx context.Context, db models.DB, r *Row) error

Update updates the Row in the database.

func Upsert

func Upsert(ctx context.Context, db models.DB, r *Row) error

Upsert performs an insert-or-update in one DB call for Games. Unlike insert, upsert requires that you have set any IDs on the row you're upserting. NOTE: PostgreSQL 9.5+ only

Types

type Row

type Row struct {
	ID        int       // id (PK)
	BoxArtURL string    // box_art_url
	CreatedAt time.Time // created_at
	Name      string    // name
	UpdatedAt time.Time // updated_at
}

Row represents a row from 'games'.

func All

func All(ctx context.Context, db models.DB) ([]*Row, error)

All retrieves all rows from 'games' as a slice of Row.

func Find

func Find(ctx context.Context, db models.DB,
	id int,
) (*Row, error)

Find retrieves a row from 'games' by its primary key(s).

func First

func First(ctx context.Context, db models.DB, where models.WhereClause, orderby models.OrderBy) (*Row, error)

First retrieve one row from 'games' when sorted by orderby.

func One

func One(ctx context.Context, db models.DB, where models.WhereClause) (*Row, error)

One retrieve one row from 'games'.

func Query

func Query(ctx context.Context, db models.DB, where models.WhereClause) ([]*Row, error)

Query retrieves rows from 'games' as a slice of Row.

func QueryOrder

func QueryOrder(ctx context.Context, db models.DB, where models.WhereClause, orderby models.OrderBy) ([]*Row, error)

QueryOrder retrieves rows from 'games' as a slice of Row in a particular order.

Jump to

Keyboard shortcuts

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