//
// Code generated by go-jet DO NOT EDIT.
//
// WARNING: Changes to this file may cause incorrect behavior
// and will be lost if the code is regenerated
//

package table

import (
	"github.com/go-jet/jet/v2/postgres"
)

var GamePlayers = newGamePlayersTable("backend", "game_players", "")

type gamePlayersTable struct {
	postgres.Table

	// Columns
	GameID      postgres.ColumnString
	Seat        postgres.ColumnInteger
	AccountID   postgres.ColumnString
	Score       postgres.ColumnInteger
	HintsUsed   postgres.ColumnInteger
	IsWinner    postgres.ColumnBool
	DisplayName postgres.ColumnString

	AllColumns     postgres.ColumnList
	MutableColumns postgres.ColumnList
	DefaultColumns postgres.ColumnList
}

type GamePlayersTable struct {
	gamePlayersTable

	EXCLUDED gamePlayersTable
}

// AS creates new GamePlayersTable with assigned alias
func (a GamePlayersTable) AS(alias string) *GamePlayersTable {
	return newGamePlayersTable(a.SchemaName(), a.TableName(), alias)
}

// Schema creates new GamePlayersTable with assigned schema name
func (a GamePlayersTable) FromSchema(schemaName string) *GamePlayersTable {
	return newGamePlayersTable(schemaName, a.TableName(), a.Alias())
}

// WithPrefix creates new GamePlayersTable with assigned table prefix
func (a GamePlayersTable) WithPrefix(prefix string) *GamePlayersTable {
	return newGamePlayersTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
}

// WithSuffix creates new GamePlayersTable with assigned table suffix
func (a GamePlayersTable) WithSuffix(suffix string) *GamePlayersTable {
	return newGamePlayersTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
}

func newGamePlayersTable(schemaName, tableName, alias string) *GamePlayersTable {
	return &GamePlayersTable{
		gamePlayersTable: newGamePlayersTableImpl(schemaName, tableName, alias),
		EXCLUDED:         newGamePlayersTableImpl("", "excluded", ""),
	}
}

func newGamePlayersTableImpl(schemaName, tableName, alias string) gamePlayersTable {
	var (
		GameIDColumn      = postgres.StringColumn("game_id")
		SeatColumn        = postgres.IntegerColumn("seat")
		AccountIDColumn   = postgres.StringColumn("account_id")
		ScoreColumn       = postgres.IntegerColumn("score")
		HintsUsedColumn   = postgres.IntegerColumn("hints_used")
		IsWinnerColumn    = postgres.BoolColumn("is_winner")
		DisplayNameColumn = postgres.StringColumn("display_name")
		allColumns        = postgres.ColumnList{GameIDColumn, SeatColumn, AccountIDColumn, ScoreColumn, HintsUsedColumn, IsWinnerColumn, DisplayNameColumn}
		mutableColumns    = postgres.ColumnList{AccountIDColumn, ScoreColumn, HintsUsedColumn, IsWinnerColumn, DisplayNameColumn}
		defaultColumns    = postgres.ColumnList{ScoreColumn, HintsUsedColumn, IsWinnerColumn, DisplayNameColumn}
	)

	return gamePlayersTable{
		Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),

		//Columns
		GameID:      GameIDColumn,
		Seat:        SeatColumn,
		AccountID:   AccountIDColumn,
		Score:       ScoreColumn,
		HintsUsed:   HintsUsedColumn,
		IsWinner:    IsWinnerColumn,
		DisplayName: DisplayNameColumn,

		AllColumns:     allColumns,
		MutableColumns: mutableColumns,
		DefaultColumns: defaultColumns,
	}
}
