//
// 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 EngineVersions = newEngineVersionsTable("backend", "engine_versions", "")

type engineVersionsTable struct {
	postgres.Table

	// Columns
	Version   postgres.ColumnString
	ImageRef  postgres.ColumnString
	Enabled   postgres.ColumnBool
	CreatedAt postgres.ColumnTimestampz
	UpdatedAt postgres.ColumnTimestampz

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

type EngineVersionsTable struct {
	engineVersionsTable

	EXCLUDED engineVersionsTable
}

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

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

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

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

func newEngineVersionsTable(schemaName, tableName, alias string) *EngineVersionsTable {
	return &EngineVersionsTable{
		engineVersionsTable: newEngineVersionsTableImpl(schemaName, tableName, alias),
		EXCLUDED:            newEngineVersionsTableImpl("", "excluded", ""),
	}
}

func newEngineVersionsTableImpl(schemaName, tableName, alias string) engineVersionsTable {
	var (
		VersionColumn   = postgres.StringColumn("version")
		ImageRefColumn  = postgres.StringColumn("image_ref")
		EnabledColumn   = postgres.BoolColumn("enabled")
		CreatedAtColumn = postgres.TimestampzColumn("created_at")
		UpdatedAtColumn = postgres.TimestampzColumn("updated_at")
		allColumns      = postgres.ColumnList{VersionColumn, ImageRefColumn, EnabledColumn, CreatedAtColumn, UpdatedAtColumn}
		mutableColumns  = postgres.ColumnList{ImageRefColumn, EnabledColumn, CreatedAtColumn, UpdatedAtColumn}
		defaultColumns  = postgres.ColumnList{EnabledColumn, CreatedAtColumn, UpdatedAtColumn}
	)

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

		//Columns
		Version:   VersionColumn,
		ImageRef:  ImageRefColumn,
		Enabled:   EnabledColumn,
		CreatedAt: CreatedAtColumn,
		UpdatedAt: UpdatedAtColumn,

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