//
// 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 ImageLinks = newImageLinksTable("haystack", "image_links", "")

type imageLinksTable struct {
	postgres.Table

	// Columns
	ID      postgres.ColumnString
	Link    postgres.ColumnString
	ImageID postgres.ColumnString

	AllColumns     postgres.ColumnList
	MutableColumns postgres.ColumnList
}

type ImageLinksTable struct {
	imageLinksTable

	EXCLUDED imageLinksTable
}

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

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

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

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

func newImageLinksTable(schemaName, tableName, alias string) *ImageLinksTable {
	return &ImageLinksTable{
		imageLinksTable: newImageLinksTableImpl(schemaName, tableName, alias),
		EXCLUDED:        newImageLinksTableImpl("", "excluded", ""),
	}
}

func newImageLinksTableImpl(schemaName, tableName, alias string) imageLinksTable {
	var (
		IDColumn       = postgres.StringColumn("id")
		LinkColumn     = postgres.StringColumn("link")
		ImageIDColumn  = postgres.StringColumn("image_id")
		allColumns     = postgres.ColumnList{IDColumn, LinkColumn, ImageIDColumn}
		mutableColumns = postgres.ColumnList{LinkColumn, ImageIDColumn}
	)

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

		//Columns
		ID:      IDColumn,
		Link:    LinkColumn,
		ImageID: ImageIDColumn,

		AllColumns:     allColumns,
		MutableColumns: mutableColumns,
	}
}
