//
// 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 Games = newGamesTable("backend", "games", "")

type gamesTable struct {
	postgres.Table

	// Columns
	GameID              postgres.ColumnString
	OwnerUserID         postgres.ColumnString
	Visibility          postgres.ColumnString
	Status              postgres.ColumnString
	GameName            postgres.ColumnString
	Description         postgres.ColumnString
	MinPlayers          postgres.ColumnInteger
	MaxPlayers          postgres.ColumnInteger
	StartGapHours       postgres.ColumnInteger
	StartGapPlayers     postgres.ColumnInteger
	EnrollmentEndsAt    postgres.ColumnTimestampz
	TurnSchedule        postgres.ColumnString
	TargetEngineVersion postgres.ColumnString
	RuntimeSnapshot     postgres.ColumnString
	RuntimeBinding      postgres.ColumnString
	CreatedAt           postgres.ColumnTimestampz
	UpdatedAt           postgres.ColumnTimestampz
	StartedAt           postgres.ColumnTimestampz
	FinishedAt          postgres.ColumnTimestampz

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

type GamesTable struct {
	gamesTable

	EXCLUDED gamesTable
}

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

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

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

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

func newGamesTable(schemaName, tableName, alias string) *GamesTable {
	return &GamesTable{
		gamesTable: newGamesTableImpl(schemaName, tableName, alias),
		EXCLUDED:   newGamesTableImpl("", "excluded", ""),
	}
}

func newGamesTableImpl(schemaName, tableName, alias string) gamesTable {
	var (
		GameIDColumn              = postgres.StringColumn("game_id")
		OwnerUserIDColumn         = postgres.StringColumn("owner_user_id")
		VisibilityColumn          = postgres.StringColumn("visibility")
		StatusColumn              = postgres.StringColumn("status")
		GameNameColumn            = postgres.StringColumn("game_name")
		DescriptionColumn         = postgres.StringColumn("description")
		MinPlayersColumn          = postgres.IntegerColumn("min_players")
		MaxPlayersColumn          = postgres.IntegerColumn("max_players")
		StartGapHoursColumn       = postgres.IntegerColumn("start_gap_hours")
		StartGapPlayersColumn     = postgres.IntegerColumn("start_gap_players")
		EnrollmentEndsAtColumn    = postgres.TimestampzColumn("enrollment_ends_at")
		TurnScheduleColumn        = postgres.StringColumn("turn_schedule")
		TargetEngineVersionColumn = postgres.StringColumn("target_engine_version")
		RuntimeSnapshotColumn     = postgres.StringColumn("runtime_snapshot")
		RuntimeBindingColumn      = postgres.StringColumn("runtime_binding")
		CreatedAtColumn           = postgres.TimestampzColumn("created_at")
		UpdatedAtColumn           = postgres.TimestampzColumn("updated_at")
		StartedAtColumn           = postgres.TimestampzColumn("started_at")
		FinishedAtColumn          = postgres.TimestampzColumn("finished_at")
		allColumns                = postgres.ColumnList{GameIDColumn, OwnerUserIDColumn, VisibilityColumn, StatusColumn, GameNameColumn, DescriptionColumn, MinPlayersColumn, MaxPlayersColumn, StartGapHoursColumn, StartGapPlayersColumn, EnrollmentEndsAtColumn, TurnScheduleColumn, TargetEngineVersionColumn, RuntimeSnapshotColumn, RuntimeBindingColumn, CreatedAtColumn, UpdatedAtColumn, StartedAtColumn, FinishedAtColumn}
		mutableColumns            = postgres.ColumnList{OwnerUserIDColumn, VisibilityColumn, StatusColumn, GameNameColumn, DescriptionColumn, MinPlayersColumn, MaxPlayersColumn, StartGapHoursColumn, StartGapPlayersColumn, EnrollmentEndsAtColumn, TurnScheduleColumn, TargetEngineVersionColumn, RuntimeSnapshotColumn, RuntimeBindingColumn, CreatedAtColumn, UpdatedAtColumn, StartedAtColumn, FinishedAtColumn}
		defaultColumns            = postgres.ColumnList{DescriptionColumn, RuntimeSnapshotColumn, CreatedAtColumn, UpdatedAtColumn}
	)

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

		//Columns
		GameID:              GameIDColumn,
		OwnerUserID:         OwnerUserIDColumn,
		Visibility:          VisibilityColumn,
		Status:              StatusColumn,
		GameName:            GameNameColumn,
		Description:         DescriptionColumn,
		MinPlayers:          MinPlayersColumn,
		MaxPlayers:          MaxPlayersColumn,
		StartGapHours:       StartGapHoursColumn,
		StartGapPlayers:     StartGapPlayersColumn,
		EnrollmentEndsAt:    EnrollmentEndsAtColumn,
		TurnSchedule:        TurnScheduleColumn,
		TargetEngineVersion: TargetEngineVersionColumn,
		RuntimeSnapshot:     RuntimeSnapshotColumn,
		RuntimeBinding:      RuntimeBindingColumn,
		CreatedAt:           CreatedAtColumn,
		UpdatedAt:           UpdatedAtColumn,
		StartedAt:           StartedAtColumn,
		FinishedAt:          FinishedAtColumn,

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