//
// 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 SpatialRefSys = newSpatialRefSysTable("public", "spatial_ref_sys", "")

type spatialRefSysTable struct {
	postgres.Table

	// Columns
	Srid      postgres.ColumnInteger
	AuthName  postgres.ColumnString
	AuthSrid  postgres.ColumnInteger
	Srtext    postgres.ColumnString
	Proj4text postgres.ColumnString

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

type SpatialRefSysTable struct {
	spatialRefSysTable

	EXCLUDED spatialRefSysTable
}

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

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

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

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

func newSpatialRefSysTable(schemaName, tableName, alias string) *SpatialRefSysTable {
	return &SpatialRefSysTable{
		spatialRefSysTable: newSpatialRefSysTableImpl(schemaName, tableName, alias),
		EXCLUDED:           newSpatialRefSysTableImpl("", "excluded", ""),
	}
}

func newSpatialRefSysTableImpl(schemaName, tableName, alias string) spatialRefSysTable {
	var (
		SridColumn      = postgres.IntegerColumn("srid")
		AuthNameColumn  = postgres.StringColumn("auth_name")
		AuthSridColumn  = postgres.IntegerColumn("auth_srid")
		SrtextColumn    = postgres.StringColumn("srtext")
		Proj4textColumn = postgres.StringColumn("proj4text")
		allColumns      = postgres.ColumnList{SridColumn, AuthNameColumn, AuthSridColumn, SrtextColumn, Proj4textColumn}
		mutableColumns  = postgres.ColumnList{AuthNameColumn, AuthSridColumn, SrtextColumn, Proj4textColumn}
		defaultColumns  = postgres.ColumnList{}
	)

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

		//Columns
		Srid:      SridColumn,
		AuthName:  AuthNameColumn,
		AuthSrid:  AuthSridColumn,
		Srtext:    SrtextColumn,
		Proj4text: Proj4textColumn,

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