106 lines
3.5 KiB
Go
106 lines
3.5 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 Invites = newInvitesTable("backend", "invites", "")
|
|
|
|
type invitesTable struct {
|
|
postgres.Table
|
|
|
|
// Columns
|
|
InviteID postgres.ColumnString
|
|
GameID postgres.ColumnString
|
|
InviterUserID postgres.ColumnString
|
|
InvitedUserID postgres.ColumnString
|
|
Code postgres.ColumnString
|
|
Status postgres.ColumnString
|
|
RaceName postgres.ColumnString
|
|
CreatedAt postgres.ColumnTimestampz
|
|
ExpiresAt postgres.ColumnTimestampz
|
|
DecidedAt postgres.ColumnTimestampz
|
|
|
|
AllColumns postgres.ColumnList
|
|
MutableColumns postgres.ColumnList
|
|
DefaultColumns postgres.ColumnList
|
|
}
|
|
|
|
type InvitesTable struct {
|
|
invitesTable
|
|
|
|
EXCLUDED invitesTable
|
|
}
|
|
|
|
// AS creates new InvitesTable with assigned alias
|
|
func (a InvitesTable) AS(alias string) *InvitesTable {
|
|
return newInvitesTable(a.SchemaName(), a.TableName(), alias)
|
|
}
|
|
|
|
// Schema creates new InvitesTable with assigned schema name
|
|
func (a InvitesTable) FromSchema(schemaName string) *InvitesTable {
|
|
return newInvitesTable(schemaName, a.TableName(), a.Alias())
|
|
}
|
|
|
|
// WithPrefix creates new InvitesTable with assigned table prefix
|
|
func (a InvitesTable) WithPrefix(prefix string) *InvitesTable {
|
|
return newInvitesTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
|
|
}
|
|
|
|
// WithSuffix creates new InvitesTable with assigned table suffix
|
|
func (a InvitesTable) WithSuffix(suffix string) *InvitesTable {
|
|
return newInvitesTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
|
|
}
|
|
|
|
func newInvitesTable(schemaName, tableName, alias string) *InvitesTable {
|
|
return &InvitesTable{
|
|
invitesTable: newInvitesTableImpl(schemaName, tableName, alias),
|
|
EXCLUDED: newInvitesTableImpl("", "excluded", ""),
|
|
}
|
|
}
|
|
|
|
func newInvitesTableImpl(schemaName, tableName, alias string) invitesTable {
|
|
var (
|
|
InviteIDColumn = postgres.StringColumn("invite_id")
|
|
GameIDColumn = postgres.StringColumn("game_id")
|
|
InviterUserIDColumn = postgres.StringColumn("inviter_user_id")
|
|
InvitedUserIDColumn = postgres.StringColumn("invited_user_id")
|
|
CodeColumn = postgres.StringColumn("code")
|
|
StatusColumn = postgres.StringColumn("status")
|
|
RaceNameColumn = postgres.StringColumn("race_name")
|
|
CreatedAtColumn = postgres.TimestampzColumn("created_at")
|
|
ExpiresAtColumn = postgres.TimestampzColumn("expires_at")
|
|
DecidedAtColumn = postgres.TimestampzColumn("decided_at")
|
|
allColumns = postgres.ColumnList{InviteIDColumn, GameIDColumn, InviterUserIDColumn, InvitedUserIDColumn, CodeColumn, StatusColumn, RaceNameColumn, CreatedAtColumn, ExpiresAtColumn, DecidedAtColumn}
|
|
mutableColumns = postgres.ColumnList{GameIDColumn, InviterUserIDColumn, InvitedUserIDColumn, CodeColumn, StatusColumn, RaceNameColumn, CreatedAtColumn, ExpiresAtColumn, DecidedAtColumn}
|
|
defaultColumns = postgres.ColumnList{RaceNameColumn, CreatedAtColumn}
|
|
)
|
|
|
|
return invitesTable{
|
|
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
|
|
|
|
//Columns
|
|
InviteID: InviteIDColumn,
|
|
GameID: GameIDColumn,
|
|
InviterUserID: InviterUserIDColumn,
|
|
InvitedUserID: InvitedUserIDColumn,
|
|
Code: CodeColumn,
|
|
Status: StatusColumn,
|
|
RaceName: RaceNameColumn,
|
|
CreatedAt: CreatedAtColumn,
|
|
ExpiresAt: ExpiresAtColumn,
|
|
DecidedAt: DecidedAtColumn,
|
|
|
|
AllColumns: allColumns,
|
|
MutableColumns: mutableColumns,
|
|
DefaultColumns: defaultColumns,
|
|
}
|
|
}
|