94 lines
3.1 KiB
Go
94 lines
3.1 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 Notifications = newNotificationsTable("backend", "notifications", "")
|
|
|
|
type notificationsTable struct {
|
|
postgres.Table
|
|
|
|
// Columns
|
|
NotificationID postgres.ColumnString
|
|
Kind postgres.ColumnString
|
|
IdempotencyKey postgres.ColumnString
|
|
UserID postgres.ColumnString
|
|
Payload postgres.ColumnString
|
|
CreatedAt postgres.ColumnTimestampz
|
|
|
|
AllColumns postgres.ColumnList
|
|
MutableColumns postgres.ColumnList
|
|
DefaultColumns postgres.ColumnList
|
|
}
|
|
|
|
type NotificationsTable struct {
|
|
notificationsTable
|
|
|
|
EXCLUDED notificationsTable
|
|
}
|
|
|
|
// AS creates new NotificationsTable with assigned alias
|
|
func (a NotificationsTable) AS(alias string) *NotificationsTable {
|
|
return newNotificationsTable(a.SchemaName(), a.TableName(), alias)
|
|
}
|
|
|
|
// Schema creates new NotificationsTable with assigned schema name
|
|
func (a NotificationsTable) FromSchema(schemaName string) *NotificationsTable {
|
|
return newNotificationsTable(schemaName, a.TableName(), a.Alias())
|
|
}
|
|
|
|
// WithPrefix creates new NotificationsTable with assigned table prefix
|
|
func (a NotificationsTable) WithPrefix(prefix string) *NotificationsTable {
|
|
return newNotificationsTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
|
|
}
|
|
|
|
// WithSuffix creates new NotificationsTable with assigned table suffix
|
|
func (a NotificationsTable) WithSuffix(suffix string) *NotificationsTable {
|
|
return newNotificationsTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
|
|
}
|
|
|
|
func newNotificationsTable(schemaName, tableName, alias string) *NotificationsTable {
|
|
return &NotificationsTable{
|
|
notificationsTable: newNotificationsTableImpl(schemaName, tableName, alias),
|
|
EXCLUDED: newNotificationsTableImpl("", "excluded", ""),
|
|
}
|
|
}
|
|
|
|
func newNotificationsTableImpl(schemaName, tableName, alias string) notificationsTable {
|
|
var (
|
|
NotificationIDColumn = postgres.StringColumn("notification_id")
|
|
KindColumn = postgres.StringColumn("kind")
|
|
IdempotencyKeyColumn = postgres.StringColumn("idempotency_key")
|
|
UserIDColumn = postgres.StringColumn("user_id")
|
|
PayloadColumn = postgres.StringColumn("payload")
|
|
CreatedAtColumn = postgres.TimestampzColumn("created_at")
|
|
allColumns = postgres.ColumnList{NotificationIDColumn, KindColumn, IdempotencyKeyColumn, UserIDColumn, PayloadColumn, CreatedAtColumn}
|
|
mutableColumns = postgres.ColumnList{KindColumn, IdempotencyKeyColumn, UserIDColumn, PayloadColumn, CreatedAtColumn}
|
|
defaultColumns = postgres.ColumnList{CreatedAtColumn}
|
|
)
|
|
|
|
return notificationsTable{
|
|
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
|
|
|
|
//Columns
|
|
NotificationID: NotificationIDColumn,
|
|
Kind: KindColumn,
|
|
IdempotencyKey: IdempotencyKeyColumn,
|
|
UserID: UserIDColumn,
|
|
Payload: PayloadColumn,
|
|
CreatedAt: CreatedAtColumn,
|
|
|
|
AllColumns: allColumns,
|
|
MutableColumns: mutableColumns,
|
|
DefaultColumns: defaultColumns,
|
|
}
|
|
}
|