//
// 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 Accounts = newAccountsTable("backend", "accounts", "")

type accountsTable struct {
	postgres.Table

	// Columns
	UserID               postgres.ColumnString
	Email                postgres.ColumnString
	UserName             postgres.ColumnString
	DisplayName          postgres.ColumnString
	PreferredLanguage    postgres.ColumnString
	TimeZone             postgres.ColumnString
	DeclaredCountry      postgres.ColumnString
	PermanentBlock       postgres.ColumnBool
	DeletedActorType     postgres.ColumnString
	DeletedActorUserID   postgres.ColumnString
	DeletedActorUsername postgres.ColumnString
	CreatedAt            postgres.ColumnTimestampz
	UpdatedAt            postgres.ColumnTimestampz
	DeletedAt            postgres.ColumnTimestampz

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

type AccountsTable struct {
	accountsTable

	EXCLUDED accountsTable
}

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

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

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

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

func newAccountsTable(schemaName, tableName, alias string) *AccountsTable {
	return &AccountsTable{
		accountsTable: newAccountsTableImpl(schemaName, tableName, alias),
		EXCLUDED:      newAccountsTableImpl("", "excluded", ""),
	}
}

func newAccountsTableImpl(schemaName, tableName, alias string) accountsTable {
	var (
		UserIDColumn               = postgres.StringColumn("user_id")
		EmailColumn                = postgres.StringColumn("email")
		UserNameColumn             = postgres.StringColumn("user_name")
		DisplayNameColumn          = postgres.StringColumn("display_name")
		PreferredLanguageColumn    = postgres.StringColumn("preferred_language")
		TimeZoneColumn             = postgres.StringColumn("time_zone")
		DeclaredCountryColumn      = postgres.StringColumn("declared_country")
		PermanentBlockColumn       = postgres.BoolColumn("permanent_block")
		DeletedActorTypeColumn     = postgres.StringColumn("deleted_actor_type")
		DeletedActorUserIDColumn   = postgres.StringColumn("deleted_actor_user_id")
		DeletedActorUsernameColumn = postgres.StringColumn("deleted_actor_username")
		CreatedAtColumn            = postgres.TimestampzColumn("created_at")
		UpdatedAtColumn            = postgres.TimestampzColumn("updated_at")
		DeletedAtColumn            = postgres.TimestampzColumn("deleted_at")
		allColumns                 = postgres.ColumnList{UserIDColumn, EmailColumn, UserNameColumn, DisplayNameColumn, PreferredLanguageColumn, TimeZoneColumn, DeclaredCountryColumn, PermanentBlockColumn, DeletedActorTypeColumn, DeletedActorUserIDColumn, DeletedActorUsernameColumn, CreatedAtColumn, UpdatedAtColumn, DeletedAtColumn}
		mutableColumns             = postgres.ColumnList{EmailColumn, UserNameColumn, DisplayNameColumn, PreferredLanguageColumn, TimeZoneColumn, DeclaredCountryColumn, PermanentBlockColumn, DeletedActorTypeColumn, DeletedActorUserIDColumn, DeletedActorUsernameColumn, CreatedAtColumn, UpdatedAtColumn, DeletedAtColumn}
		defaultColumns             = postgres.ColumnList{DisplayNameColumn, PermanentBlockColumn, CreatedAtColumn, UpdatedAtColumn}
	)

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

		//Columns
		UserID:               UserIDColumn,
		Email:                EmailColumn,
		UserName:             UserNameColumn,
		DisplayName:          DisplayNameColumn,
		PreferredLanguage:    PreferredLanguageColumn,
		TimeZone:             TimeZoneColumn,
		DeclaredCountry:      DeclaredCountryColumn,
		PermanentBlock:       PermanentBlockColumn,
		DeletedActorType:     DeletedActorTypeColumn,
		DeletedActorUserID:   DeletedActorUserIDColumn,
		DeletedActorUsername: DeletedActorUsernameColumn,
		CreatedAt:            CreatedAtColumn,
		UpdatedAt:            UpdatedAtColumn,
		DeletedAt:            DeletedAtColumn,

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