//
// 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 PrivilegeLevels = newPrivilegeLevelsTable("auth", "privilege_levels", "")

type privilegeLevelsTable struct {
	postgres.Table

	// Columns
	ID        postgres.ColumnInteger
	Name      postgres.ColumnString
	CreatedAt postgres.ColumnTimestamp
	UpdatedAt postgres.ColumnTimestamp

	AllColumns     postgres.ColumnList
	MutableColumns postgres.ColumnList
}

type PrivilegeLevelsTable struct {
	privilegeLevelsTable

	EXCLUDED privilegeLevelsTable
}

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

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

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

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

func newPrivilegeLevelsTable(schemaName, tableName, alias string) *PrivilegeLevelsTable {
	return &PrivilegeLevelsTable{
		privilegeLevelsTable: newPrivilegeLevelsTableImpl(schemaName, tableName, alias),
		EXCLUDED:             newPrivilegeLevelsTableImpl("", "excluded", ""),
	}
}

func newPrivilegeLevelsTableImpl(schemaName, tableName, alias string) privilegeLevelsTable {
	var (
		IDColumn        = postgres.IntegerColumn("id")
		NameColumn      = postgres.StringColumn("name")
		CreatedAtColumn = postgres.TimestampColumn("created_at")
		UpdatedAtColumn = postgres.TimestampColumn("updated_at")
		allColumns      = postgres.ColumnList{IDColumn, NameColumn, CreatedAtColumn, UpdatedAtColumn}
		mutableColumns  = postgres.ColumnList{NameColumn, CreatedAtColumn, UpdatedAtColumn}
	)

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

		//Columns
		ID:        IDColumn,
		Name:      NameColumn,
		CreatedAt: CreatedAtColumn,
		UpdatedAt: UpdatedAtColumn,

		AllColumns:     allColumns,
		MutableColumns: mutableColumns,
	}
}
