//
// 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/Gleipnir-Technology/jet/postgres"
)

var Address = newAddressTable("public", "address", "")

type addressTable struct {
	postgres.Table

	// Columns
	Country    postgres.ColumnString
	Created    postgres.ColumnTimestamp
	Location   postgres.ColumnGeometry
	H3cell     postgres.ColumnString
	ID         postgres.ColumnInteger
	Locality   postgres.ColumnString
	PostalCode postgres.ColumnString
	Street     postgres.ColumnString
	Unit       postgres.ColumnString
	Region     postgres.ColumnString
	Number     postgres.ColumnString
	Gid        postgres.ColumnString

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

type AddressTable struct {
	addressTable

	EXCLUDED addressTable
}

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

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

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

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

func newAddressTable(schemaName, tableName, alias string) *AddressTable {
	return &AddressTable{
		addressTable: newAddressTableImpl(schemaName, tableName, alias),
		EXCLUDED:     newAddressTableImpl("", "excluded", ""),
	}
}

func newAddressTableImpl(schemaName, tableName, alias string) addressTable {
	var (
		CountryColumn    = postgres.StringColumn("country")
		CreatedColumn    = postgres.TimestampColumn("created")
		LocationColumn   = postgres.GeometryColumn("location")
		H3cellColumn     = postgres.StringColumn("h3cell")
		IDColumn         = postgres.IntegerColumn("id")
		LocalityColumn   = postgres.StringColumn("locality")
		PostalCodeColumn = postgres.StringColumn("postal_code")
		StreetColumn     = postgres.StringColumn("street")
		UnitColumn       = postgres.StringColumn("unit")
		RegionColumn     = postgres.StringColumn("region")
		NumberColumn     = postgres.StringColumn("number_")
		GidColumn        = postgres.StringColumn("gid")
		allColumns       = postgres.ColumnList{CountryColumn, CreatedColumn, LocationColumn, H3cellColumn, IDColumn, LocalityColumn, PostalCodeColumn, StreetColumn, UnitColumn, RegionColumn, NumberColumn, GidColumn}
		mutableColumns   = postgres.ColumnList{CountryColumn, CreatedColumn, LocationColumn, H3cellColumn, LocalityColumn, PostalCodeColumn, StreetColumn, UnitColumn, RegionColumn, NumberColumn, GidColumn}
		defaultColumns   = postgres.ColumnList{IDColumn}
	)

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

		//Columns
		Country:    CountryColumn,
		Created:    CreatedColumn,
		Location:   LocationColumn,
		H3cell:     H3cellColumn,
		ID:         IDColumn,
		Locality:   LocalityColumn,
		PostalCode: PostalCodeColumn,
		Street:     StreetColumn,
		Unit:       UnitColumn,
		Region:     RegionColumn,
		Number:     NumberColumn,
		Gid:        GidColumn,

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