sqlc

package
v0.0.0-...-bd93615 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type Game

type Game struct {
	ID                  int64
	Score               int32
	MaxTimesThroughDeck int32
}

type History

type History struct {
	ID         int64
	GameID     int64
	MoveID     int64
	MoveNumber int32
}

type LookupGameDetailRow

type LookupGameDetailRow struct {
	ID                  int64
	Score               int32
	MaxTimesThroughDeck int32
	Piles               interface{}
	History             interface{}
}

type Move

type Move struct {
	ID              int64
	OldPileNum      int16
	OldPileIndex    int16
	OldPilePosition int16
	NewPileNum      int16
	NewPileIndex    int16
	NewPilePosition int16
}

type PileCard

type PileCard struct {
	ID        int64
	PileNum   int16
	PileIndex int16
	Suit      int16
	Index     int16
	Position  int32
	GameID    int64
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) LookupGameDetail

func (q *Queries) LookupGameDetail(ctx context.Context, gameID int64) (LookupGameDetailRow, error)

Lookup a game.

func (*Queries) SavePerformMove

func (q *Queries) SavePerformMove(ctx context.Context, arg SavePerformMoveParams) ([]SavePerformMoveRow, error)

Make a move.

func (*Queries) SaveStartGame

func (q *Queries) SaveStartGame(ctx context.Context, arg SaveStartGameParams) (int64, error)

Start a game.

func (*Queries) SearchGame

func (q *Queries) SearchGame(ctx context.Context, arg SearchGameParams) ([]SearchGameRow, error)

Search returns a list of games.

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type SavePerformMoveParams

type SavePerformMoveParams struct {
	GameID           int64
	OldPileNums      interface{}
	OldPileIndexes   interface{}
	OldPilePositions interface{}
	NewPileNums      interface{}
	NewPileIndexes   interface{}
	NewPilePositions interface{}
}

type SavePerformMoveRow

type SavePerformMoveRow struct {
	GameID int64
	MoveID int64
}

type SaveStartGameParams

type SaveStartGameParams struct {
	Score               int32
	MaxTimesThroughDeck int32
	PileNums            []int16
	PileIndexes         []int16
	Suits               []int16
	Indexes             []int16
	Positions           []int32
}

type SearchGameParams

type SearchGameParams struct {
	Limit  int32
	Offset int32
}

type SearchGameRow

type SearchGameRow struct {
	ID    int64
	Score int32
}

Jump to

Keyboard shortcuts

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