twitchuser

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 = "twitch_user"

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

Variables

View Source
var (
	BroadcasterTypeCol models.StringField   = "broadcaster_type"
	CreatedAtCol       models.TimeTimeField = "created_at"
	DescriptionCol     models.StringField   = "description"
	DisplayNameCol     models.StringField   = "display_name"
	IDCol              models.StringField   = "id"
	LoginCol           models.StringField   = "login"
	OfflineImageURLCol models.StringField   = "offline_image_url"
	ProfileImageURLCol models.StringField   = "profile_image_url"
	TypeCol            models.StringField   = "type"
	UpdatedAtCol       models.TimeTimeField = "updated_at"
	ViewCountCol       models.IntField      = "view_count"
)

Field values for every column in TwitchUser.

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 'twitch_user'.

func Delete

func Delete(ctx context.Context,
	db models.DB,
	id string,
) (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 TwitchUser. 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              string    // id (PK)
	BroadcasterType string    // broadcaster_type
	CreatedAt       time.Time // created_at
	Description     string    // description
	DisplayName     string    // display_name
	Login           string    // login
	OfflineImageURL string    // offline_image_url
	ProfileImageURL string    // profile_image_url
	Type            string    // type
	UpdatedAt       time.Time // updated_at
	ViewCount       int       // view_count
}

Row represents a row from 'twitch_user'.

func All

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

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

func Find

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

Find retrieves a row from 'twitch_user' 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 'twitch_user' when sorted by orderby.

func One

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

One retrieve one row from 'twitch_user'.

func Query

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

Query retrieves rows from 'twitch_user' 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 'twitch_user' 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