87 lines
2.7 KiB
Go
87 lines
2.7 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/Gleipnir-Technology/jet/postgres"
|
|
)
|
|
|
|
var ContactEmail = newContactEmailTable("comms", "contact_email", "")
|
|
|
|
type contactEmailTable struct {
|
|
postgres.Table
|
|
|
|
// Columns
|
|
Address postgres.ColumnString
|
|
Confirmed postgres.ColumnBool
|
|
ContactID postgres.ColumnInteger
|
|
IsSubscribed postgres.ColumnBool
|
|
|
|
AllColumns postgres.ColumnList
|
|
MutableColumns postgres.ColumnList
|
|
DefaultColumns postgres.ColumnList
|
|
}
|
|
|
|
type ContactEmailTable struct {
|
|
contactEmailTable
|
|
|
|
EXCLUDED contactEmailTable
|
|
}
|
|
|
|
// AS creates new ContactEmailTable with assigned alias
|
|
func (a ContactEmailTable) AS(alias string) *ContactEmailTable {
|
|
return newContactEmailTable(a.SchemaName(), a.TableName(), alias)
|
|
}
|
|
|
|
// Schema creates new ContactEmailTable with assigned schema name
|
|
func (a ContactEmailTable) FromSchema(schemaName string) *ContactEmailTable {
|
|
return newContactEmailTable(schemaName, a.TableName(), a.Alias())
|
|
}
|
|
|
|
// WithPrefix creates new ContactEmailTable with assigned table prefix
|
|
func (a ContactEmailTable) WithPrefix(prefix string) *ContactEmailTable {
|
|
return newContactEmailTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
|
|
}
|
|
|
|
// WithSuffix creates new ContactEmailTable with assigned table suffix
|
|
func (a ContactEmailTable) WithSuffix(suffix string) *ContactEmailTable {
|
|
return newContactEmailTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
|
|
}
|
|
|
|
func newContactEmailTable(schemaName, tableName, alias string) *ContactEmailTable {
|
|
return &ContactEmailTable{
|
|
contactEmailTable: newContactEmailTableImpl(schemaName, tableName, alias),
|
|
EXCLUDED: newContactEmailTableImpl("", "excluded", ""),
|
|
}
|
|
}
|
|
|
|
func newContactEmailTableImpl(schemaName, tableName, alias string) contactEmailTable {
|
|
var (
|
|
AddressColumn = postgres.StringColumn("address")
|
|
ConfirmedColumn = postgres.BoolColumn("confirmed")
|
|
ContactIDColumn = postgres.IntegerColumn("contact_id")
|
|
IsSubscribedColumn = postgres.BoolColumn("is_subscribed")
|
|
allColumns = postgres.ColumnList{AddressColumn, ConfirmedColumn, ContactIDColumn, IsSubscribedColumn}
|
|
mutableColumns = postgres.ColumnList{ConfirmedColumn, ContactIDColumn, IsSubscribedColumn}
|
|
defaultColumns = postgres.ColumnList{}
|
|
)
|
|
|
|
return contactEmailTable{
|
|
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
|
|
|
|
//Columns
|
|
Address: AddressColumn,
|
|
Confirmed: ConfirmedColumn,
|
|
ContactID: ContactIDColumn,
|
|
IsSubscribed: IsSubscribedColumn,
|
|
|
|
AllColumns: allColumns,
|
|
MutableColumns: mutableColumns,
|
|
DefaultColumns: defaultColumns,
|
|
}
|
|
}
|