//
// 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 TextFiles = newTextFilesTable("public", "text_files", "")

type textFilesTable struct {
	postgres.Table

	// Columns
	ID        postgres.ColumnInteger
	Sha256    postgres.ColumnString
	Content   postgres.ColumnString
	CreatedAt postgres.ColumnTimestampz

	AllColumns     postgres.ColumnList
	MutableColumns postgres.ColumnList
}

type TextFilesTable struct {
	textFilesTable

	EXCLUDED textFilesTable
}

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

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

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

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

func newTextFilesTable(schemaName, tableName, alias string) *TextFilesTable {
	return &TextFilesTable{
		textFilesTable: newTextFilesTableImpl(schemaName, tableName, alias),
		EXCLUDED:       newTextFilesTableImpl("", "excluded", ""),
	}
}

func newTextFilesTableImpl(schemaName, tableName, alias string) textFilesTable {
	var (
		IDColumn        = postgres.IntegerColumn("id")
		Sha256Column    = postgres.StringColumn("sha256")
		ContentColumn   = postgres.StringColumn("content")
		CreatedAtColumn = postgres.TimestampzColumn("created_at")
		allColumns      = postgres.ColumnList{IDColumn, Sha256Column, ContentColumn, CreatedAtColumn}
		mutableColumns  = postgres.ColumnList{Sha256Column, ContentColumn, CreatedAtColumn}
	)

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

		//Columns
		ID:        IDColumn,
		Sha256:    Sha256Column,
		Content:   ContentColumn,
		CreatedAt: CreatedAtColumn,

		AllColumns:     allColumns,
		MutableColumns: mutableColumns,
	}
}
