//
// 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 ImageEvents = newImageEventsTable("haystack", "image_events", "")

type imageEventsTable struct {
	postgres.Table

	// Columns
	ID        postgres.ColumnString
	EventID   postgres.ColumnString
	ImageID   postgres.ColumnString
	CreatedAt postgres.ColumnTimestampz

	AllColumns     postgres.ColumnList
	MutableColumns postgres.ColumnList
}

type ImageEventsTable struct {
	imageEventsTable

	EXCLUDED imageEventsTable
}

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

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

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

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

func newImageEventsTable(schemaName, tableName, alias string) *ImageEventsTable {
	return &ImageEventsTable{
		imageEventsTable: newImageEventsTableImpl(schemaName, tableName, alias),
		EXCLUDED:         newImageEventsTableImpl("", "excluded", ""),
	}
}

func newImageEventsTableImpl(schemaName, tableName, alias string) imageEventsTable {
	var (
		IDColumn        = postgres.StringColumn("id")
		EventIDColumn   = postgres.StringColumn("event_id")
		ImageIDColumn   = postgres.StringColumn("image_id")
		CreatedAtColumn = postgres.TimestampzColumn("created_at")
		allColumns      = postgres.ColumnList{IDColumn, EventIDColumn, ImageIDColumn, CreatedAtColumn}
		mutableColumns  = postgres.ColumnList{EventIDColumn, ImageIDColumn, CreatedAtColumn}
	)

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

		//Columns
		ID:        IDColumn,
		EventID:   EventIDColumn,
		ImageID:   ImageIDColumn,
		CreatedAt: CreatedAtColumn,

		AllColumns:     allColumns,
		MutableColumns: mutableColumns,
	}
}
