//
// 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 ServiceFeature = newServiceFeatureTable("arcgis", "service_feature", "")

type serviceFeatureTable struct {
	postgres.Table

	// Columns
	Extent           postgres.ColumnString
	ItemID           postgres.ColumnString
	SpatialReference postgres.ColumnInteger
	URL              postgres.ColumnString
	AccountID        postgres.ColumnString

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

type ServiceFeatureTable struct {
	serviceFeatureTable

	EXCLUDED serviceFeatureTable
}

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

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

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

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

func newServiceFeatureTable(schemaName, tableName, alias string) *ServiceFeatureTable {
	return &ServiceFeatureTable{
		serviceFeatureTable: newServiceFeatureTableImpl(schemaName, tableName, alias),
		EXCLUDED:            newServiceFeatureTableImpl("", "excluded", ""),
	}
}

func newServiceFeatureTableImpl(schemaName, tableName, alias string) serviceFeatureTable {
	var (
		ExtentColumn           = postgres.StringColumn("extent")
		ItemIDColumn           = postgres.StringColumn("item_id")
		SpatialReferenceColumn = postgres.IntegerColumn("spatial_reference")
		URLColumn              = postgres.StringColumn("url")
		AccountIDColumn        = postgres.StringColumn("account_id")
		allColumns             = postgres.ColumnList{ExtentColumn, ItemIDColumn, SpatialReferenceColumn, URLColumn, AccountIDColumn}
		mutableColumns         = postgres.ColumnList{ExtentColumn, SpatialReferenceColumn, URLColumn, AccountIDColumn}
		defaultColumns         = postgres.ColumnList{}
	)

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

		//Columns
		Extent:           ExtentColumn,
		ItemID:           ItemIDColumn,
		SpatialReference: SpatialReferenceColumn,
		URL:              URLColumn,
		AccountID:        AccountIDColumn,

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