//
// 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 H3Aggregation = newH3AggregationTable("public", "h3_aggregation", "")

type h3AggregationTable struct {
	postgres.Table

	// Columns
	ID             postgres.ColumnInteger
	Cell           postgres.ColumnString
	Count          postgres.ColumnInteger
	Geometry       postgres.ColumnGeometry
	OrganizationID postgres.ColumnInteger
	Resolution     postgres.ColumnInteger
	Type           postgres.ColumnString

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

type H3AggregationTable struct {
	h3AggregationTable

	EXCLUDED h3AggregationTable
}

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

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

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

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

func newH3AggregationTable(schemaName, tableName, alias string) *H3AggregationTable {
	return &H3AggregationTable{
		h3AggregationTable: newH3AggregationTableImpl(schemaName, tableName, alias),
		EXCLUDED:           newH3AggregationTableImpl("", "excluded", ""),
	}
}

func newH3AggregationTableImpl(schemaName, tableName, alias string) h3AggregationTable {
	var (
		IDColumn             = postgres.IntegerColumn("id")
		CellColumn           = postgres.StringColumn("cell")
		CountColumn          = postgres.IntegerColumn("count_")
		GeometryColumn       = postgres.GeometryColumn("geometry")
		OrganizationIDColumn = postgres.IntegerColumn("organization_id")
		ResolutionColumn     = postgres.IntegerColumn("resolution")
		TypeColumn           = postgres.StringColumn("type_")
		allColumns           = postgres.ColumnList{IDColumn, CellColumn, CountColumn, GeometryColumn, OrganizationIDColumn, ResolutionColumn, TypeColumn}
		mutableColumns       = postgres.ColumnList{CellColumn, CountColumn, GeometryColumn, OrganizationIDColumn, ResolutionColumn, TypeColumn}
		defaultColumns       = postgres.ColumnList{IDColumn}
	)

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

		//Columns
		ID:             IDColumn,
		Cell:           CellColumn,
		Count:          CountColumn,
		Geometry:       GeometryColumn,
		OrganizationID: OrganizationIDColumn,
		Resolution:     ResolutionColumn,
		Type:           TypeColumn,

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