//
// 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 RuntimeHealthSnapshots = newRuntimeHealthSnapshotsTable("backend", "runtime_health_snapshots", "")

type runtimeHealthSnapshotsTable struct {
	postgres.Table

	// Columns
	SnapshotID postgres.ColumnString
	GameID     postgres.ColumnString
	ObservedAt postgres.ColumnTimestampz
	Payload    postgres.ColumnString

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

type RuntimeHealthSnapshotsTable struct {
	runtimeHealthSnapshotsTable

	EXCLUDED runtimeHealthSnapshotsTable
}

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

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

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

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

func newRuntimeHealthSnapshotsTable(schemaName, tableName, alias string) *RuntimeHealthSnapshotsTable {
	return &RuntimeHealthSnapshotsTable{
		runtimeHealthSnapshotsTable: newRuntimeHealthSnapshotsTableImpl(schemaName, tableName, alias),
		EXCLUDED:                    newRuntimeHealthSnapshotsTableImpl("", "excluded", ""),
	}
}

func newRuntimeHealthSnapshotsTableImpl(schemaName, tableName, alias string) runtimeHealthSnapshotsTable {
	var (
		SnapshotIDColumn = postgres.StringColumn("snapshot_id")
		GameIDColumn     = postgres.StringColumn("game_id")
		ObservedAtColumn = postgres.TimestampzColumn("observed_at")
		PayloadColumn    = postgres.StringColumn("payload")
		allColumns       = postgres.ColumnList{SnapshotIDColumn, GameIDColumn, ObservedAtColumn, PayloadColumn}
		mutableColumns   = postgres.ColumnList{GameIDColumn, ObservedAtColumn, PayloadColumn}
		defaultColumns   = postgres.ColumnList{ObservedAtColumn}
	)

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

		//Columns
		SnapshotID: SnapshotIDColumn,
		GameID:     GameIDColumn,
		ObservedAt: ObservedAtColumn,
		Payload:    PayloadColumn,

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