//
// 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 UserTags = newUserTagsTable("haystack", "user_tags", "")

type userTagsTable struct {
	postgres.Table

	// Columns
	ID     postgres.ColumnString
	Tag    postgres.ColumnString
	UserID postgres.ColumnString

	AllColumns     postgres.ColumnList
	MutableColumns postgres.ColumnList
}

type UserTagsTable struct {
	userTagsTable

	EXCLUDED userTagsTable
}

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

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

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

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

func newUserTagsTable(schemaName, tableName, alias string) *UserTagsTable {
	return &UserTagsTable{
		userTagsTable: newUserTagsTableImpl(schemaName, tableName, alias),
		EXCLUDED:      newUserTagsTableImpl("", "excluded", ""),
	}
}

func newUserTagsTableImpl(schemaName, tableName, alias string) userTagsTable {
	var (
		IDColumn       = postgres.StringColumn("id")
		TagColumn      = postgres.StringColumn("tag")
		UserIDColumn   = postgres.StringColumn("user_id")
		allColumns     = postgres.ColumnList{IDColumn, TagColumn, UserIDColumn}
		mutableColumns = postgres.ColumnList{TagColumn, UserIDColumn}
	)

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

		//Columns
		ID:     IDColumn,
		Tag:    TagColumn,
		UserID: UserIDColumn,

		AllColumns:     allColumns,
		MutableColumns: mutableColumns,
	}
}
