//
// 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 PlayerMappings = newPlayerMappingsTable("backend", "player_mappings", "")

type playerMappingsTable struct {
	postgres.Table

	// Columns
	GameID           postgres.ColumnString
	UserID           postgres.ColumnString
	RaceName         postgres.ColumnString
	EnginePlayerUUID postgres.ColumnString
	CreatedAt        postgres.ColumnTimestampz

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

type PlayerMappingsTable struct {
	playerMappingsTable

	EXCLUDED playerMappingsTable
}

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

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

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

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

func newPlayerMappingsTable(schemaName, tableName, alias string) *PlayerMappingsTable {
	return &PlayerMappingsTable{
		playerMappingsTable: newPlayerMappingsTableImpl(schemaName, tableName, alias),
		EXCLUDED:            newPlayerMappingsTableImpl("", "excluded", ""),
	}
}

func newPlayerMappingsTableImpl(schemaName, tableName, alias string) playerMappingsTable {
	var (
		GameIDColumn           = postgres.StringColumn("game_id")
		UserIDColumn           = postgres.StringColumn("user_id")
		RaceNameColumn         = postgres.StringColumn("race_name")
		EnginePlayerUUIDColumn = postgres.StringColumn("engine_player_uuid")
		CreatedAtColumn        = postgres.TimestampzColumn("created_at")
		allColumns             = postgres.ColumnList{GameIDColumn, UserIDColumn, RaceNameColumn, EnginePlayerUUIDColumn, CreatedAtColumn}
		mutableColumns         = postgres.ColumnList{RaceNameColumn, EnginePlayerUUIDColumn, CreatedAtColumn}
		defaultColumns         = postgres.ColumnList{CreatedAtColumn}
	)

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

		//Columns
		GameID:           GameIDColumn,
		UserID:           UserIDColumn,
		RaceName:         RaceNameColumn,
		EnginePlayerUUID: EnginePlayerUUIDColumn,
		CreatedAt:        CreatedAtColumn,

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