//
// 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 Client = newClientTable("publicreport", "client", "")

type clientTable struct {
	postgres.Table

	// Columns
	Created   postgres.ColumnTimestamp
	UserAgent postgres.ColumnString
	UUID      postgres.ColumnString

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

type ClientTable struct {
	clientTable

	EXCLUDED clientTable
}

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

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

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

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

func newClientTable(schemaName, tableName, alias string) *ClientTable {
	return &ClientTable{
		clientTable: newClientTableImpl(schemaName, tableName, alias),
		EXCLUDED:    newClientTableImpl("", "excluded", ""),
	}
}

func newClientTableImpl(schemaName, tableName, alias string) clientTable {
	var (
		CreatedColumn   = postgres.TimestampColumn("created")
		UserAgentColumn = postgres.StringColumn("user_agent")
		UUIDColumn      = postgres.StringColumn("uuid")
		allColumns      = postgres.ColumnList{CreatedColumn, UserAgentColumn, UUIDColumn}
		mutableColumns  = postgres.ColumnList{CreatedColumn, UserAgentColumn}
		defaultColumns  = postgres.ColumnList{}
	)

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

		//Columns
		Created:   CreatedColumn,
		UserAgent: UserAgentColumn,
		UUID:      UUIDColumn,

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