//
// 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 StatementExamples = newStatementExamplesTable("public", "statement_examples", "")

type statementExamplesTable struct {
	postgres.Table

	// Columns
	ID            postgres.ColumnInteger
	Input         postgres.ColumnString
	Answer        postgres.ColumnString
	TaskVersionID postgres.ColumnInteger

	AllColumns     postgres.ColumnList
	MutableColumns postgres.ColumnList
}

type StatementExamplesTable struct {
	statementExamplesTable

	EXCLUDED statementExamplesTable
}

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

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

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

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

func newStatementExamplesTable(schemaName, tableName, alias string) *StatementExamplesTable {
	return &StatementExamplesTable{
		statementExamplesTable: newStatementExamplesTableImpl(schemaName, tableName, alias),
		EXCLUDED:               newStatementExamplesTableImpl("", "excluded", ""),
	}
}

func newStatementExamplesTableImpl(schemaName, tableName, alias string) statementExamplesTable {
	var (
		IDColumn            = postgres.IntegerColumn("id")
		InputColumn         = postgres.StringColumn("input")
		AnswerColumn        = postgres.StringColumn("answer")
		TaskVersionIDColumn = postgres.IntegerColumn("task_version_id")
		allColumns          = postgres.ColumnList{IDColumn, InputColumn, AnswerColumn, TaskVersionIDColumn}
		mutableColumns      = postgres.ColumnList{IDColumn, InputColumn, AnswerColumn, TaskVersionIDColumn}
	)

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

		//Columns
		ID:            IDColumn,
		Input:         InputColumn,
		Answer:        AnswerColumn,
		TaskVersionID: TaskVersionIDColumn,

		AllColumns:     allColumns,
		MutableColumns: mutableColumns,
	}
}
