//
// 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 FeaturePool = newFeaturePoolTable("public", "feature_pool", "")

type featurePoolTable struct {
	postgres.Table

	// Columns
	FeatureID   postgres.ColumnInteger
	Condition   postgres.ColumnString
	DepthMeters postgres.ColumnFloat
	Geometry    postgres.ColumnGeometry

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

type FeaturePoolTable struct {
	featurePoolTable

	EXCLUDED featurePoolTable
}

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

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

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

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

func newFeaturePoolTable(schemaName, tableName, alias string) *FeaturePoolTable {
	return &FeaturePoolTable{
		featurePoolTable: newFeaturePoolTableImpl(schemaName, tableName, alias),
		EXCLUDED:         newFeaturePoolTableImpl("", "excluded", ""),
	}
}

func newFeaturePoolTableImpl(schemaName, tableName, alias string) featurePoolTable {
	var (
		FeatureIDColumn   = postgres.IntegerColumn("feature_id")
		ConditionColumn   = postgres.StringColumn("condition")
		DepthMetersColumn = postgres.FloatColumn("depth_meters")
		GeometryColumn    = postgres.GeometryColumn("geometry")
		allColumns        = postgres.ColumnList{FeatureIDColumn, ConditionColumn, DepthMetersColumn, GeometryColumn}
		mutableColumns    = postgres.ColumnList{ConditionColumn, DepthMetersColumn, GeometryColumn}
		defaultColumns    = postgres.ColumnList{}
	)

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

		//Columns
		FeatureID:   FeatureIDColumn,
		Condition:   ConditionColumn,
		DepthMeters: DepthMetersColumn,
		Geometry:    GeometryColumn,

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