//
// 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/go-jet/jet/v2/postgres"
)

var ImageText = newImageTextTable("haystack", "image_text", "")

type imageTextTable struct {
	postgres.Table

	// Columns
	ID        postgres.ColumnString
	ImageText postgres.ColumnString
	ImageID   postgres.ColumnString

	AllColumns     postgres.ColumnList
	MutableColumns postgres.ColumnList
}

type ImageTextTable struct {
	imageTextTable

	EXCLUDED imageTextTable
}

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

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

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

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

func newImageTextTable(schemaName, tableName, alias string) *ImageTextTable {
	return &ImageTextTable{
		imageTextTable: newImageTextTableImpl(schemaName, tableName, alias),
		EXCLUDED:       newImageTextTableImpl("", "excluded", ""),
	}
}

func newImageTextTableImpl(schemaName, tableName, alias string) imageTextTable {
	var (
		IDColumn        = postgres.StringColumn("id")
		ImageTextColumn = postgres.StringColumn("image_text")
		ImageIDColumn   = postgres.StringColumn("image_id")
		allColumns      = postgres.ColumnList{IDColumn, ImageTextColumn, ImageIDColumn}
		mutableColumns  = postgres.ColumnList{ImageTextColumn, ImageIDColumn}
	)

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

		//Columns
		ID:        IDColumn,
		ImageText: ImageTextColumn,
		ImageID:   ImageIDColumn,

		AllColumns:     allColumns,
		MutableColumns: mutableColumns,
	}
}
