//
// 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 RuntimeStatistics = newRuntimeStatisticsTable("public", "runtime_statistics", "")

type runtimeStatisticsTable struct {
	postgres.Table

	// Columns
	ID                     postgres.ColumnInteger
	MaximumTimeMillis      postgres.ColumnInteger
	MaximumMemoryKibibytes postgres.ColumnInteger
	TotalTimeMillis        postgres.ColumnInteger
	TotalMemoryKibibytes   postgres.ColumnInteger
	AvgTimeMillis          postgres.ColumnFloat
	AvgMemoryKibibytes     postgres.ColumnFloat

	AllColumns     postgres.ColumnList
	MutableColumns postgres.ColumnList
}

type RuntimeStatisticsTable struct {
	runtimeStatisticsTable

	EXCLUDED runtimeStatisticsTable
}

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

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

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

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

func newRuntimeStatisticsTable(schemaName, tableName, alias string) *RuntimeStatisticsTable {
	return &RuntimeStatisticsTable{
		runtimeStatisticsTable: newRuntimeStatisticsTableImpl(schemaName, tableName, alias),
		EXCLUDED:               newRuntimeStatisticsTableImpl("", "excluded", ""),
	}
}

func newRuntimeStatisticsTableImpl(schemaName, tableName, alias string) runtimeStatisticsTable {
	var (
		IDColumn                     = postgres.IntegerColumn("id")
		MaximumTimeMillisColumn      = postgres.IntegerColumn("maximum_time_millis")
		MaximumMemoryKibibytesColumn = postgres.IntegerColumn("maximum_memory_kibibytes")
		TotalTimeMillisColumn        = postgres.IntegerColumn("total_time_millis")
		TotalMemoryKibibytesColumn   = postgres.IntegerColumn("total_memory_kibibytes")
		AvgTimeMillisColumn          = postgres.FloatColumn("avg_time_millis")
		AvgMemoryKibibytesColumn     = postgres.FloatColumn("avg_memory_kibibytes")
		allColumns                   = postgres.ColumnList{IDColumn, MaximumTimeMillisColumn, MaximumMemoryKibibytesColumn, TotalTimeMillisColumn, TotalMemoryKibibytesColumn, AvgTimeMillisColumn, AvgMemoryKibibytesColumn}
		mutableColumns               = postgres.ColumnList{MaximumTimeMillisColumn, MaximumMemoryKibibytesColumn, TotalTimeMillisColumn, TotalMemoryKibibytesColumn, AvgTimeMillisColumn, AvgMemoryKibibytesColumn}
	)

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

		//Columns
		ID:                     IDColumn,
		MaximumTimeMillis:      MaximumTimeMillisColumn,
		MaximumMemoryKibibytes: MaximumMemoryKibibytesColumn,
		TotalTimeMillis:        TotalTimeMillisColumn,
		TotalMemoryKibibytes:   TotalMemoryKibibytesColumn,
		AvgTimeMillis:          AvgTimeMillisColumn,
		AvgMemoryKibibytes:     AvgMemoryKibibytesColumn,

		AllColumns:     allColumns,
		MutableColumns: mutableColumns,
	}
}
