//
// 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 TestlibCheckers = newTestlibCheckersTable("public", "testlib_checkers", "")

type testlibCheckersTable struct {
	postgres.Table

	// Columns
	ID   postgres.ColumnInteger
	Code postgres.ColumnString

	AllColumns     postgres.ColumnList
	MutableColumns postgres.ColumnList
}

type TestlibCheckersTable struct {
	testlibCheckersTable

	EXCLUDED testlibCheckersTable
}

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

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

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

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

func newTestlibCheckersTable(schemaName, tableName, alias string) *TestlibCheckersTable {
	return &TestlibCheckersTable{
		testlibCheckersTable: newTestlibCheckersTableImpl(schemaName, tableName, alias),
		EXCLUDED:             newTestlibCheckersTableImpl("", "excluded", ""),
	}
}

func newTestlibCheckersTableImpl(schemaName, tableName, alias string) testlibCheckersTable {
	var (
		IDColumn       = postgres.IntegerColumn("id")
		CodeColumn     = postgres.StringColumn("code")
		allColumns     = postgres.ColumnList{IDColumn, CodeColumn}
		mutableColumns = postgres.ColumnList{CodeColumn}
	)

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

		//Columns
		ID:   IDColumn,
		Code: CodeColumn,

		AllColumns:     allColumns,
		MutableColumns: mutableColumns,
	}
}
