//
// 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 RasterOverviews = newRasterOverviewsTable("public", "raster_overviews", "")

type rasterOverviewsTable struct {
	postgres.Table

	// Columns
	OTableCatalog  postgres.ColumnString
	OTableSchema   postgres.ColumnString
	OTableName     postgres.ColumnString
	ORasterColumn  postgres.ColumnString
	RTableCatalog  postgres.ColumnString
	RTableSchema   postgres.ColumnString
	RTableName     postgres.ColumnString
	RRasterColumn  postgres.ColumnString
	OverviewFactor postgres.ColumnInteger

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

type RasterOverviewsTable struct {
	rasterOverviewsTable

	EXCLUDED rasterOverviewsTable
}

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

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

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

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

func newRasterOverviewsTable(schemaName, tableName, alias string) *RasterOverviewsTable {
	return &RasterOverviewsTable{
		rasterOverviewsTable: newRasterOverviewsTableImpl(schemaName, tableName, alias),
		EXCLUDED:             newRasterOverviewsTableImpl("", "excluded", ""),
	}
}

func newRasterOverviewsTableImpl(schemaName, tableName, alias string) rasterOverviewsTable {
	var (
		OTableCatalogColumn  = postgres.StringColumn("o_table_catalog")
		OTableSchemaColumn   = postgres.StringColumn("o_table_schema")
		OTableNameColumn     = postgres.StringColumn("o_table_name")
		ORasterColumnColumn  = postgres.StringColumn("o_raster_column")
		RTableCatalogColumn  = postgres.StringColumn("r_table_catalog")
		RTableSchemaColumn   = postgres.StringColumn("r_table_schema")
		RTableNameColumn     = postgres.StringColumn("r_table_name")
		RRasterColumnColumn  = postgres.StringColumn("r_raster_column")
		OverviewFactorColumn = postgres.IntegerColumn("overview_factor")
		allColumns           = postgres.ColumnList{OTableCatalogColumn, OTableSchemaColumn, OTableNameColumn, ORasterColumnColumn, RTableCatalogColumn, RTableSchemaColumn, RTableNameColumn, RRasterColumnColumn, OverviewFactorColumn}
		mutableColumns       = postgres.ColumnList{OTableCatalogColumn, OTableSchemaColumn, OTableNameColumn, ORasterColumnColumn, RTableCatalogColumn, RTableSchemaColumn, RTableNameColumn, RRasterColumnColumn, OverviewFactorColumn}
		defaultColumns       = postgres.ColumnList{}
	)

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

		//Columns
		OTableCatalog:  OTableCatalogColumn,
		OTableSchema:   OTableSchemaColumn,
		OTableName:     OTableNameColumn,
		ORasterColumn:  ORasterColumnColumn,
		RTableCatalog:  RTableCatalogColumn,
		RTableSchema:   RTableSchemaColumn,
		RTableName:     RTableNameColumn,
		RRasterColumn:  RRasterColumnColumn,
		OverviewFactor: OverviewFactorColumn,

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