Files
2025-04-18 17:30:11 -04:00

106 lines
3.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 Loads = newLoadsTable("public", "loads", "")
type loadsTable struct {
postgres.Table
// Columns
ID postgres.ColumnString
CartridgeID postgres.ColumnString
Col postgres.ColumnFloat
PowderID postgres.ColumnString
PowderGr postgres.ColumnFloat
PrimerID postgres.ColumnString
BulletID postgres.ColumnString
Photo postgres.ColumnBytea
CreatedAt postgres.ColumnTimestamp
Meta postgres.ColumnString
AllColumns postgres.ColumnList
MutableColumns postgres.ColumnList
DefaultColumns postgres.ColumnList
}
type LoadsTable struct {
loadsTable
EXCLUDED loadsTable
}
// AS creates new LoadsTable with assigned alias
func (a LoadsTable) AS(alias string) *LoadsTable {
return newLoadsTable(a.SchemaName(), a.TableName(), alias)
}
// Schema creates new LoadsTable with assigned schema name
func (a LoadsTable) FromSchema(schemaName string) *LoadsTable {
return newLoadsTable(schemaName, a.TableName(), a.Alias())
}
// WithPrefix creates new LoadsTable with assigned table prefix
func (a LoadsTable) WithPrefix(prefix string) *LoadsTable {
return newLoadsTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
}
// WithSuffix creates new LoadsTable with assigned table suffix
func (a LoadsTable) WithSuffix(suffix string) *LoadsTable {
return newLoadsTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
}
func newLoadsTable(schemaName, tableName, alias string) *LoadsTable {
return &LoadsTable{
loadsTable: newLoadsTableImpl(schemaName, tableName, alias),
EXCLUDED: newLoadsTableImpl("", "excluded", ""),
}
}
func newLoadsTableImpl(schemaName, tableName, alias string) loadsTable {
var (
IDColumn = postgres.StringColumn("id")
CartridgeIDColumn = postgres.StringColumn("cartridge_id")
ColColumn = postgres.FloatColumn("col")
PowderIDColumn = postgres.StringColumn("powder_id")
PowderGrColumn = postgres.FloatColumn("powder_gr")
PrimerIDColumn = postgres.StringColumn("primer_id")
BulletIDColumn = postgres.StringColumn("bullet_id")
PhotoColumn = postgres.ByteaColumn("photo")
CreatedAtColumn = postgres.TimestampColumn("created_at")
MetaColumn = postgres.StringColumn("meta")
allColumns = postgres.ColumnList{IDColumn, CartridgeIDColumn, ColColumn, PowderIDColumn, PowderGrColumn, PrimerIDColumn, BulletIDColumn, PhotoColumn, CreatedAtColumn, MetaColumn}
mutableColumns = postgres.ColumnList{CartridgeIDColumn, ColColumn, PowderIDColumn, PowderGrColumn, PrimerIDColumn, BulletIDColumn, PhotoColumn, CreatedAtColumn, MetaColumn}
defaultColumns = postgres.ColumnList{IDColumn, CreatedAtColumn}
)
return loadsTable{
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
//Columns
ID: IDColumn,
CartridgeID: CartridgeIDColumn,
Col: ColColumn,
PowderID: PowderIDColumn,
PowderGr: PowderGrColumn,
PrimerID: PrimerIDColumn,
BulletID: BulletIDColumn,
Photo: PhotoColumn,
CreatedAt: CreatedAtColumn,
Meta: MetaColumn,
AllColumns: allColumns,
MutableColumns: mutableColumns,
DefaultColumns: defaultColumns,
}
}