88 lines
2.6 KiB
Go
88 lines
2.6 KiB
Go
//
|
|
// 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 SchemaItems = newSchemaItemsTable("haystack", "schema_items", "")
|
|
|
|
type schemaItemsTable struct {
|
|
postgres.Table
|
|
|
|
// Columns
|
|
ID postgres.ColumnString
|
|
Item postgres.ColumnString
|
|
Value postgres.ColumnString
|
|
Description postgres.ColumnString
|
|
SchemaID postgres.ColumnString
|
|
|
|
AllColumns postgres.ColumnList
|
|
MutableColumns postgres.ColumnList
|
|
}
|
|
|
|
type SchemaItemsTable struct {
|
|
schemaItemsTable
|
|
|
|
EXCLUDED schemaItemsTable
|
|
}
|
|
|
|
// AS creates new SchemaItemsTable with assigned alias
|
|
func (a SchemaItemsTable) AS(alias string) *SchemaItemsTable {
|
|
return newSchemaItemsTable(a.SchemaName(), a.TableName(), alias)
|
|
}
|
|
|
|
// Schema creates new SchemaItemsTable with assigned schema name
|
|
func (a SchemaItemsTable) FromSchema(schemaName string) *SchemaItemsTable {
|
|
return newSchemaItemsTable(schemaName, a.TableName(), a.Alias())
|
|
}
|
|
|
|
// WithPrefix creates new SchemaItemsTable with assigned table prefix
|
|
func (a SchemaItemsTable) WithPrefix(prefix string) *SchemaItemsTable {
|
|
return newSchemaItemsTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
|
|
}
|
|
|
|
// WithSuffix creates new SchemaItemsTable with assigned table suffix
|
|
func (a SchemaItemsTable) WithSuffix(suffix string) *SchemaItemsTable {
|
|
return newSchemaItemsTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
|
|
}
|
|
|
|
func newSchemaItemsTable(schemaName, tableName, alias string) *SchemaItemsTable {
|
|
return &SchemaItemsTable{
|
|
schemaItemsTable: newSchemaItemsTableImpl(schemaName, tableName, alias),
|
|
EXCLUDED: newSchemaItemsTableImpl("", "excluded", ""),
|
|
}
|
|
}
|
|
|
|
func newSchemaItemsTableImpl(schemaName, tableName, alias string) schemaItemsTable {
|
|
var (
|
|
IDColumn = postgres.StringColumn("id")
|
|
ItemColumn = postgres.StringColumn("item")
|
|
ValueColumn = postgres.StringColumn("value")
|
|
DescriptionColumn = postgres.StringColumn("description")
|
|
SchemaIDColumn = postgres.StringColumn("schema_id")
|
|
allColumns = postgres.ColumnList{IDColumn, ItemColumn, ValueColumn, DescriptionColumn, SchemaIDColumn}
|
|
mutableColumns = postgres.ColumnList{ItemColumn, ValueColumn, DescriptionColumn, SchemaIDColumn}
|
|
)
|
|
|
|
return schemaItemsTable{
|
|
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
|
|
|
|
//Columns
|
|
ID: IDColumn,
|
|
Item: ItemColumn,
|
|
Value: ValueColumn,
|
|
Description: DescriptionColumn,
|
|
SchemaID: SchemaIDColumn,
|
|
|
|
AllColumns: allColumns,
|
|
MutableColumns: mutableColumns,
|
|
}
|
|
}
|