//
// 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 CatalogAtom = newCatalogAtomTable("payments", "catalog_atom", "")

type catalogAtomTable struct {
	postgres.Table

	// Columns
	AtomType postgres.ColumnString

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

type CatalogAtomTable struct {
	catalogAtomTable

	EXCLUDED catalogAtomTable
}

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

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

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

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

func newCatalogAtomTable(schemaName, tableName, alias string) *CatalogAtomTable {
	return &CatalogAtomTable{
		catalogAtomTable: newCatalogAtomTableImpl(schemaName, tableName, alias),
		EXCLUDED:         newCatalogAtomTableImpl("", "excluded", ""),
	}
}

func newCatalogAtomTableImpl(schemaName, tableName, alias string) catalogAtomTable {
	var (
		AtomTypeColumn = postgres.StringColumn("atom_type")
		allColumns     = postgres.ColumnList{AtomTypeColumn}
		mutableColumns = postgres.ColumnList{}
		defaultColumns = postgres.ColumnList{}
	)

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

		//Columns
		AtomType: AtomTypeColumn,

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