97 lines
2.9 KiB
Go
97 lines
2.9 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 Channels = newChannelsTable("public", "channels", "")
|
|
|
|
type channelsTable struct {
|
|
postgres.Table
|
|
|
|
// Columns
|
|
ID postgres.ColumnInteger
|
|
UUID postgres.ColumnInteger
|
|
Username postgres.ColumnString
|
|
Title postgres.ColumnString
|
|
CreatedAt postgres.ColumnTimestampz
|
|
UpdatedAt postgres.ColumnTimestampz
|
|
Offset postgres.ColumnInteger
|
|
MinID postgres.ColumnInteger
|
|
|
|
AllColumns postgres.ColumnList
|
|
MutableColumns postgres.ColumnList
|
|
}
|
|
|
|
type ChannelsTable struct {
|
|
channelsTable
|
|
|
|
EXCLUDED channelsTable
|
|
}
|
|
|
|
// AS creates new ChannelsTable with assigned alias
|
|
func (a ChannelsTable) AS(alias string) *ChannelsTable {
|
|
return newChannelsTable(a.SchemaName(), a.TableName(), alias)
|
|
}
|
|
|
|
// Schema creates new ChannelsTable with assigned schema name
|
|
func (a ChannelsTable) FromSchema(schemaName string) *ChannelsTable {
|
|
return newChannelsTable(schemaName, a.TableName(), a.Alias())
|
|
}
|
|
|
|
// WithPrefix creates new ChannelsTable with assigned table prefix
|
|
func (a ChannelsTable) WithPrefix(prefix string) *ChannelsTable {
|
|
return newChannelsTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
|
|
}
|
|
|
|
// WithSuffix creates new ChannelsTable with assigned table suffix
|
|
func (a ChannelsTable) WithSuffix(suffix string) *ChannelsTable {
|
|
return newChannelsTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
|
|
}
|
|
|
|
func newChannelsTable(schemaName, tableName, alias string) *ChannelsTable {
|
|
return &ChannelsTable{
|
|
channelsTable: newChannelsTableImpl(schemaName, tableName, alias),
|
|
EXCLUDED: newChannelsTableImpl("", "excluded", ""),
|
|
}
|
|
}
|
|
|
|
func newChannelsTableImpl(schemaName, tableName, alias string) channelsTable {
|
|
var (
|
|
IDColumn = postgres.IntegerColumn("id")
|
|
UUIDColumn = postgres.IntegerColumn("uuid")
|
|
UsernameColumn = postgres.StringColumn("username")
|
|
TitleColumn = postgres.StringColumn("title")
|
|
CreatedAtColumn = postgres.TimestampzColumn("created_at")
|
|
UpdatedAtColumn = postgres.TimestampzColumn("updated_at")
|
|
OffsetColumn = postgres.IntegerColumn("offset")
|
|
MinIDColumn = postgres.IntegerColumn("min_id")
|
|
allColumns = postgres.ColumnList{IDColumn, UUIDColumn, UsernameColumn, TitleColumn, CreatedAtColumn, UpdatedAtColumn, OffsetColumn, MinIDColumn}
|
|
mutableColumns = postgres.ColumnList{UUIDColumn, UsernameColumn, TitleColumn, CreatedAtColumn, UpdatedAtColumn, OffsetColumn, MinIDColumn}
|
|
)
|
|
|
|
return channelsTable{
|
|
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
|
|
|
|
//Columns
|
|
ID: IDColumn,
|
|
UUID: UUIDColumn,
|
|
Username: UsernameColumn,
|
|
Title: TitleColumn,
|
|
CreatedAt: CreatedAtColumn,
|
|
UpdatedAt: UpdatedAtColumn,
|
|
Offset: OffsetColumn,
|
|
MinID: MinIDColumn,
|
|
|
|
AllColumns: allColumns,
|
|
MutableColumns: mutableColumns,
|
|
}
|
|
}
|