//
// 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 ImageTags = newImageTagsTable("haystack", "image_tags", "")

type imageTagsTable struct {
	postgres.Table

	// Columns
	ID      postgres.ColumnString
	TagID   postgres.ColumnString
	ImageID postgres.ColumnString

	AllColumns     postgres.ColumnList
	MutableColumns postgres.ColumnList
}

type ImageTagsTable struct {
	imageTagsTable

	EXCLUDED imageTagsTable
}

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

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

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

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

func newImageTagsTable(schemaName, tableName, alias string) *ImageTagsTable {
	return &ImageTagsTable{
		imageTagsTable: newImageTagsTableImpl(schemaName, tableName, alias),
		EXCLUDED:       newImageTagsTableImpl("", "excluded", ""),
	}
}

func newImageTagsTableImpl(schemaName, tableName, alias string) imageTagsTable {
	var (
		IDColumn       = postgres.StringColumn("id")
		TagIDColumn    = postgres.StringColumn("tag_id")
		ImageIDColumn  = postgres.StringColumn("image_id")
		allColumns     = postgres.ColumnList{IDColumn, TagIDColumn, ImageIDColumn}
		mutableColumns = postgres.ColumnList{TagIDColumn, ImageIDColumn}
	)

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

		//Columns
		ID:      IDColumn,
		TagID:   TagIDColumn,
		ImageID: ImageIDColumn,

		AllColumns:     allColumns,
		MutableColumns: mutableColumns,
	}
}
