//
// 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 AdminAccounts = newAdminAccountsTable("backend", "admin_accounts", "")

type adminAccountsTable struct {
	postgres.Table

	// Columns
	Username     postgres.ColumnString
	PasswordHash postgres.ColumnBytea
	CreatedAt    postgres.ColumnTimestampz
	LastUsedAt   postgres.ColumnTimestampz
	DisabledAt   postgres.ColumnTimestampz

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

type AdminAccountsTable struct {
	adminAccountsTable

	EXCLUDED adminAccountsTable
}

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

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

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

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

func newAdminAccountsTable(schemaName, tableName, alias string) *AdminAccountsTable {
	return &AdminAccountsTable{
		adminAccountsTable: newAdminAccountsTableImpl(schemaName, tableName, alias),
		EXCLUDED:           newAdminAccountsTableImpl("", "excluded", ""),
	}
}

func newAdminAccountsTableImpl(schemaName, tableName, alias string) adminAccountsTable {
	var (
		UsernameColumn     = postgres.StringColumn("username")
		PasswordHashColumn = postgres.ByteaColumn("password_hash")
		CreatedAtColumn    = postgres.TimestampzColumn("created_at")
		LastUsedAtColumn   = postgres.TimestampzColumn("last_used_at")
		DisabledAtColumn   = postgres.TimestampzColumn("disabled_at")
		allColumns         = postgres.ColumnList{UsernameColumn, PasswordHashColumn, CreatedAtColumn, LastUsedAtColumn, DisabledAtColumn}
		mutableColumns     = postgres.ColumnList{PasswordHashColumn, CreatedAtColumn, LastUsedAtColumn, DisabledAtColumn}
		defaultColumns     = postgres.ColumnList{CreatedAtColumn}
	)

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

		//Columns
		Username:     UsernameColumn,
		PasswordHash: PasswordHashColumn,
		CreatedAt:    CreatedAtColumn,
		LastUsedAt:   LastUsedAtColumn,
		DisabledAt:   DisabledAtColumn,

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