//
// 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 RuntimeData = newRuntimeDataTable("public", "runtime_data", "")

type runtimeDataTable struct {
	postgres.Table

	// Columns
	ID              postgres.ColumnInteger
	Stdout          postgres.ColumnString
	Stderr          postgres.ColumnString
	TimeMillis      postgres.ColumnInteger
	MemoryKibibytes postgres.ColumnInteger
	TimeWallMillis  postgres.ColumnInteger
	ExitCode        postgres.ColumnInteger

	AllColumns     postgres.ColumnList
	MutableColumns postgres.ColumnList
}

type RuntimeDataTable struct {
	runtimeDataTable

	EXCLUDED runtimeDataTable
}

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

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

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

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

func newRuntimeDataTable(schemaName, tableName, alias string) *RuntimeDataTable {
	return &RuntimeDataTable{
		runtimeDataTable: newRuntimeDataTableImpl(schemaName, tableName, alias),
		EXCLUDED:         newRuntimeDataTableImpl("", "excluded", ""),
	}
}

func newRuntimeDataTableImpl(schemaName, tableName, alias string) runtimeDataTable {
	var (
		IDColumn              = postgres.IntegerColumn("id")
		StdoutColumn          = postgres.StringColumn("stdout")
		StderrColumn          = postgres.StringColumn("stderr")
		TimeMillisColumn      = postgres.IntegerColumn("time_millis")
		MemoryKibibytesColumn = postgres.IntegerColumn("memory_kibibytes")
		TimeWallMillisColumn  = postgres.IntegerColumn("time_wall_millis")
		ExitCodeColumn        = postgres.IntegerColumn("exit_code")
		allColumns            = postgres.ColumnList{IDColumn, StdoutColumn, StderrColumn, TimeMillisColumn, MemoryKibibytesColumn, TimeWallMillisColumn, ExitCodeColumn}
		mutableColumns        = postgres.ColumnList{StdoutColumn, StderrColumn, TimeMillisColumn, MemoryKibibytesColumn, TimeWallMillisColumn, ExitCodeColumn}
	)

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

		//Columns
		ID:              IDColumn,
		Stdout:          StdoutColumn,
		Stderr:          StderrColumn,
		TimeMillis:      TimeMillisColumn,
		MemoryKibibytes: MemoryKibibytesColumn,
		TimeWallMillis:  TimeWallMillisColumn,
		ExitCode:        ExitCodeColumn,

		AllColumns:     allColumns,
		MutableColumns: mutableColumns,
	}
}
