//
// 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 view

import (
	"github.com/Gleipnir-Technology/jet/postgres"
)

var GeometryColumns = newGeometryColumnsTable("public", "geometry_columns", "")

type geometryColumnsTable struct {
	postgres.Table

	// Columns
	FTableCatalog   postgres.ColumnString
	FTableSchema    postgres.ColumnString
	FTableName      postgres.ColumnString
	FGeometryColumn postgres.ColumnString
	CoordDimension  postgres.ColumnInteger
	Srid            postgres.ColumnInteger
	Type            postgres.ColumnString

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

type GeometryColumnsTable struct {
	geometryColumnsTable

	EXCLUDED geometryColumnsTable
}

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

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

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

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

func newGeometryColumnsTable(schemaName, tableName, alias string) *GeometryColumnsTable {
	return &GeometryColumnsTable{
		geometryColumnsTable: newGeometryColumnsTableImpl(schemaName, tableName, alias),
		EXCLUDED:             newGeometryColumnsTableImpl("", "excluded", ""),
	}
}

func newGeometryColumnsTableImpl(schemaName, tableName, alias string) geometryColumnsTable {
	var (
		FTableCatalogColumn   = postgres.StringColumn("f_table_catalog")
		FTableSchemaColumn    = postgres.StringColumn("f_table_schema")
		FTableNameColumn      = postgres.StringColumn("f_table_name")
		FGeometryColumnColumn = postgres.StringColumn("f_geometry_column")
		CoordDimensionColumn  = postgres.IntegerColumn("coord_dimension")
		SridColumn            = postgres.IntegerColumn("srid")
		TypeColumn            = postgres.StringColumn("type")
		allColumns            = postgres.ColumnList{FTableCatalogColumn, FTableSchemaColumn, FTableNameColumn, FGeometryColumnColumn, CoordDimensionColumn, SridColumn, TypeColumn}
		mutableColumns        = postgres.ColumnList{FTableCatalogColumn, FTableSchemaColumn, FTableNameColumn, FGeometryColumnColumn, CoordDimensionColumn, SridColumn, TypeColumn}
		defaultColumns        = postgres.ColumnList{}
	)

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

		//Columns
		FTableCatalog:   FTableCatalogColumn,
		FTableSchema:    FTableSchemaColumn,
		FTableName:      FTableNameColumn,
		FGeometryColumn: FGeometryColumnColumn,
		CoordDimension:  CoordDimensionColumn,
		Srid:            SridColumn,
		Type:            TypeColumn,

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