94 lines
2.8 KiB
Go
94 lines
2.8 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 Storages = newStoragesTable("public", "storages", "")
|
|
|
|
type storagesTable struct {
|
|
postgres.Table
|
|
|
|
// Columns
|
|
ID postgres.ColumnInteger
|
|
CreatedAt postgres.ColumnTimestamp
|
|
UpdatedAt postgres.ColumnTimestamp
|
|
IsDefault postgres.ColumnBool
|
|
Name postgres.ColumnString
|
|
Type postgres.ColumnInteger
|
|
Config postgres.ColumnString
|
|
|
|
AllColumns postgres.ColumnList
|
|
MutableColumns postgres.ColumnList
|
|
}
|
|
|
|
type StoragesTable struct {
|
|
storagesTable
|
|
|
|
EXCLUDED storagesTable
|
|
}
|
|
|
|
// AS creates new StoragesTable with assigned alias
|
|
func (a StoragesTable) AS(alias string) *StoragesTable {
|
|
return newStoragesTable(a.SchemaName(), a.TableName(), alias)
|
|
}
|
|
|
|
// Schema creates new StoragesTable with assigned schema name
|
|
func (a StoragesTable) FromSchema(schemaName string) *StoragesTable {
|
|
return newStoragesTable(schemaName, a.TableName(), a.Alias())
|
|
}
|
|
|
|
// WithPrefix creates new StoragesTable with assigned table prefix
|
|
func (a StoragesTable) WithPrefix(prefix string) *StoragesTable {
|
|
return newStoragesTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
|
|
}
|
|
|
|
// WithSuffix creates new StoragesTable with assigned table suffix
|
|
func (a StoragesTable) WithSuffix(suffix string) *StoragesTable {
|
|
return newStoragesTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
|
|
}
|
|
|
|
func newStoragesTable(schemaName, tableName, alias string) *StoragesTable {
|
|
return &StoragesTable{
|
|
storagesTable: newStoragesTableImpl(schemaName, tableName, alias),
|
|
EXCLUDED: newStoragesTableImpl("", "excluded", ""),
|
|
}
|
|
}
|
|
|
|
func newStoragesTableImpl(schemaName, tableName, alias string) storagesTable {
|
|
var (
|
|
IDColumn = postgres.IntegerColumn("id")
|
|
CreatedAtColumn = postgres.TimestampColumn("created_at")
|
|
UpdatedAtColumn = postgres.TimestampColumn("updated_at")
|
|
IsDefaultColumn = postgres.BoolColumn("is_default")
|
|
NameColumn = postgres.StringColumn("name")
|
|
TypeColumn = postgres.IntegerColumn("type")
|
|
ConfigColumn = postgres.StringColumn("config")
|
|
allColumns = postgres.ColumnList{IDColumn, CreatedAtColumn, UpdatedAtColumn, IsDefaultColumn, NameColumn, TypeColumn, ConfigColumn}
|
|
mutableColumns = postgres.ColumnList{CreatedAtColumn, UpdatedAtColumn, IsDefaultColumn, NameColumn, TypeColumn, ConfigColumn}
|
|
)
|
|
|
|
return storagesTable{
|
|
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
|
|
|
|
//Columns
|
|
ID: IDColumn,
|
|
CreatedAt: CreatedAtColumn,
|
|
UpdatedAt: UpdatedAtColumn,
|
|
IsDefault: IsDefaultColumn,
|
|
Name: NameColumn,
|
|
Type: TypeColumn,
|
|
Config: ConfigColumn,
|
|
|
|
AllColumns: allColumns,
|
|
MutableColumns: mutableColumns,
|
|
}
|
|
}
|