82 lines
2.3 KiB
Go
82 lines
2.3 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 UserEvents = newUserEventsTable("haystack", "user_events", "")
|
|
|
|
type userEventsTable struct {
|
|
postgres.Table
|
|
|
|
// Columns
|
|
ID postgres.ColumnString
|
|
EventID postgres.ColumnString
|
|
UserID postgres.ColumnString
|
|
|
|
AllColumns postgres.ColumnList
|
|
MutableColumns postgres.ColumnList
|
|
}
|
|
|
|
type UserEventsTable struct {
|
|
userEventsTable
|
|
|
|
EXCLUDED userEventsTable
|
|
}
|
|
|
|
// AS creates new UserEventsTable with assigned alias
|
|
func (a UserEventsTable) AS(alias string) *UserEventsTable {
|
|
return newUserEventsTable(a.SchemaName(), a.TableName(), alias)
|
|
}
|
|
|
|
// Schema creates new UserEventsTable with assigned schema name
|
|
func (a UserEventsTable) FromSchema(schemaName string) *UserEventsTable {
|
|
return newUserEventsTable(schemaName, a.TableName(), a.Alias())
|
|
}
|
|
|
|
// WithPrefix creates new UserEventsTable with assigned table prefix
|
|
func (a UserEventsTable) WithPrefix(prefix string) *UserEventsTable {
|
|
return newUserEventsTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
|
|
}
|
|
|
|
// WithSuffix creates new UserEventsTable with assigned table suffix
|
|
func (a UserEventsTable) WithSuffix(suffix string) *UserEventsTable {
|
|
return newUserEventsTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
|
|
}
|
|
|
|
func newUserEventsTable(schemaName, tableName, alias string) *UserEventsTable {
|
|
return &UserEventsTable{
|
|
userEventsTable: newUserEventsTableImpl(schemaName, tableName, alias),
|
|
EXCLUDED: newUserEventsTableImpl("", "excluded", ""),
|
|
}
|
|
}
|
|
|
|
func newUserEventsTableImpl(schemaName, tableName, alias string) userEventsTable {
|
|
var (
|
|
IDColumn = postgres.StringColumn("id")
|
|
EventIDColumn = postgres.StringColumn("event_id")
|
|
UserIDColumn = postgres.StringColumn("user_id")
|
|
allColumns = postgres.ColumnList{IDColumn, EventIDColumn, UserIDColumn}
|
|
mutableColumns = postgres.ColumnList{EventIDColumn, UserIDColumn}
|
|
)
|
|
|
|
return userEventsTable{
|
|
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
|
|
|
|
//Columns
|
|
ID: IDColumn,
|
|
EventID: EventIDColumn,
|
|
UserID: UserIDColumn,
|
|
|
|
AllColumns: allColumns,
|
|
MutableColumns: mutableColumns,
|
|
}
|
|
}
|