//
// 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 RobotBlocks = newRobotBlocksTable("backend", "robot_blocks", "")

type robotBlocksTable struct {
	postgres.Table

	// Columns
	ID          postgres.ColumnString
	BlockerID   postgres.ColumnString
	GameID      postgres.ColumnString
	Seat        postgres.ColumnInteger
	RobotID     postgres.ColumnString
	DisplayName postgres.ColumnString
	CreatedAt   postgres.ColumnTimestampz

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

type RobotBlocksTable struct {
	robotBlocksTable

	EXCLUDED robotBlocksTable
}

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

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

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

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

func newRobotBlocksTable(schemaName, tableName, alias string) *RobotBlocksTable {
	return &RobotBlocksTable{
		robotBlocksTable: newRobotBlocksTableImpl(schemaName, tableName, alias),
		EXCLUDED:         newRobotBlocksTableImpl("", "excluded", ""),
	}
}

func newRobotBlocksTableImpl(schemaName, tableName, alias string) robotBlocksTable {
	var (
		IDColumn          = postgres.StringColumn("id")
		BlockerIDColumn   = postgres.StringColumn("blocker_id")
		GameIDColumn      = postgres.StringColumn("game_id")
		SeatColumn        = postgres.IntegerColumn("seat")
		RobotIDColumn     = postgres.StringColumn("robot_id")
		DisplayNameColumn = postgres.StringColumn("display_name")
		CreatedAtColumn   = postgres.TimestampzColumn("created_at")
		allColumns        = postgres.ColumnList{IDColumn, BlockerIDColumn, GameIDColumn, SeatColumn, RobotIDColumn, DisplayNameColumn, CreatedAtColumn}
		mutableColumns    = postgres.ColumnList{BlockerIDColumn, GameIDColumn, SeatColumn, RobotIDColumn, DisplayNameColumn, CreatedAtColumn}
		defaultColumns    = postgres.ColumnList{CreatedAtColumn}
	)

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

		//Columns
		ID:          IDColumn,
		BlockerID:   BlockerIDColumn,
		GameID:      GameIDColumn,
		Seat:        SeatColumn,
		RobotID:     RobotIDColumn,
		DisplayName: DisplayNameColumn,
		CreatedAt:   CreatedAtColumn,

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