//
// 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 RaceNames = newRaceNamesTable("backend", "race_names", "")

type raceNamesTable struct {
	postgres.Table

	// Columns
	Name         postgres.ColumnString
	Canonical    postgres.ColumnString
	Status       postgres.ColumnString
	OwnerUserID  postgres.ColumnString
	GameID       postgres.ColumnString
	SourceGameID postgres.ColumnString
	ReservedAt   postgres.ColumnTimestampz
	ExpiresAt    postgres.ColumnTimestampz
	RegisteredAt postgres.ColumnTimestampz

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

type RaceNamesTable struct {
	raceNamesTable

	EXCLUDED raceNamesTable
}

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

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

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

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

func newRaceNamesTable(schemaName, tableName, alias string) *RaceNamesTable {
	return &RaceNamesTable{
		raceNamesTable: newRaceNamesTableImpl(schemaName, tableName, alias),
		EXCLUDED:       newRaceNamesTableImpl("", "excluded", ""),
	}
}

func newRaceNamesTableImpl(schemaName, tableName, alias string) raceNamesTable {
	var (
		NameColumn         = postgres.StringColumn("name")
		CanonicalColumn    = postgres.StringColumn("canonical")
		StatusColumn       = postgres.StringColumn("status")
		OwnerUserIDColumn  = postgres.StringColumn("owner_user_id")
		GameIDColumn       = postgres.StringColumn("game_id")
		SourceGameIDColumn = postgres.StringColumn("source_game_id")
		ReservedAtColumn   = postgres.TimestampzColumn("reserved_at")
		ExpiresAtColumn    = postgres.TimestampzColumn("expires_at")
		RegisteredAtColumn = postgres.TimestampzColumn("registered_at")
		allColumns         = postgres.ColumnList{NameColumn, CanonicalColumn, StatusColumn, OwnerUserIDColumn, GameIDColumn, SourceGameIDColumn, ReservedAtColumn, ExpiresAtColumn, RegisteredAtColumn}
		mutableColumns     = postgres.ColumnList{NameColumn, StatusColumn, OwnerUserIDColumn, SourceGameIDColumn, ReservedAtColumn, ExpiresAtColumn, RegisteredAtColumn}
		defaultColumns     = postgres.ColumnList{GameIDColumn}
	)

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

		//Columns
		Name:         NameColumn,
		Canonical:    CanonicalColumn,
		Status:       StatusColumn,
		OwnerUserID:  OwnerUserIDColumn,
		GameID:       GameIDColumn,
		SourceGameID: SourceGameIDColumn,
		ReservedAt:   ReservedAtColumn,
		ExpiresAt:    ExpiresAtColumn,
		RegisteredAt: RegisteredAtColumn,

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