//
// 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/Gleipnir-Technology/jet/postgres"
)

var SubscribeEmail = newSubscribeEmailTable("publicreport", "subscribe_email", "")

type subscribeEmailTable struct {
	postgres.Table

	// Columns
	Created      postgres.ColumnTimestamp
	Deleted      postgres.ColumnTimestamp
	EmailAddress postgres.ColumnString
	ID           postgres.ColumnInteger

	AllColumns     postgres.ColumnList
	MutableColumns postgres.ColumnList
	DefaultColumns postgres.ColumnList
}

type SubscribeEmailTable struct {
	subscribeEmailTable

	EXCLUDED subscribeEmailTable
}

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

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

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

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

func newSubscribeEmailTable(schemaName, tableName, alias string) *SubscribeEmailTable {
	return &SubscribeEmailTable{
		subscribeEmailTable: newSubscribeEmailTableImpl(schemaName, tableName, alias),
		EXCLUDED:            newSubscribeEmailTableImpl("", "excluded", ""),
	}
}

func newSubscribeEmailTableImpl(schemaName, tableName, alias string) subscribeEmailTable {
	var (
		CreatedColumn      = postgres.TimestampColumn("created")
		DeletedColumn      = postgres.TimestampColumn("deleted")
		EmailAddressColumn = postgres.StringColumn("email_address")
		IDColumn           = postgres.IntegerColumn("id")
		allColumns         = postgres.ColumnList{CreatedColumn, DeletedColumn, EmailAddressColumn, IDColumn}
		mutableColumns     = postgres.ColumnList{CreatedColumn, DeletedColumn, EmailAddressColumn}
		defaultColumns     = postgres.ColumnList{IDColumn}
	)

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

		//Columns
		Created:      CreatedColumn,
		Deleted:      DeletedColumn,
		EmailAddress: EmailAddressColumn,
		ID:           IDColumn,

		AllColumns:     allColumns,
		MutableColumns: mutableColumns,
		DefaultColumns: defaultColumns,
	}
}
