You've already forked reloading-manager
Nobody had ever created a function like this one before. (#26)
Reviewed-on: rrise/reloading-manager#26 Co-authored-by: Ron Rise <ron@siteworxpro.com> Co-committed-by: Ron Rise <ron@siteworxpro.com>
This commit is contained in:
24
backend/.gen/loading/public/model/bullets.go
Normal file
24
backend/.gen/loading/public/model/bullets.go
Normal file
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// 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 model
|
||||
|
||||
import (
|
||||
"github.com/google/uuid"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Bullets struct {
|
||||
ID uuid.UUID `sql:"primary_key"`
|
||||
Name string
|
||||
Weight int32
|
||||
Diameter int32
|
||||
Meta *string
|
||||
Photo *[]byte
|
||||
ManufacturerID uuid.UUID
|
||||
CreatedAt time.Time
|
||||
}
|
||||
20
backend/.gen/loading/public/model/cartridges.go
Normal file
20
backend/.gen/loading/public/model/cartridges.go
Normal file
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// 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 model
|
||||
|
||||
import (
|
||||
"github.com/google/uuid"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Cartridges struct {
|
||||
ID uuid.UUID `sql:"primary_key"`
|
||||
Name string
|
||||
CreatedAt time.Time
|
||||
Meta string
|
||||
}
|
||||
26
backend/.gen/loading/public/model/loads.go
Normal file
26
backend/.gen/loading/public/model/loads.go
Normal file
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// 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 model
|
||||
|
||||
import (
|
||||
"github.com/google/uuid"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Loads struct {
|
||||
ID uuid.UUID `sql:"primary_key"`
|
||||
CartridgeID uuid.UUID
|
||||
Col float32
|
||||
PowderID uuid.UUID
|
||||
PowderGr float32
|
||||
PrimerID uuid.UUID
|
||||
BulletID uuid.UUID
|
||||
Photo []byte
|
||||
CreatedAt time.Time
|
||||
Meta string
|
||||
}
|
||||
20
backend/.gen/loading/public/model/manufacturers.go
Normal file
20
backend/.gen/loading/public/model/manufacturers.go
Normal file
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// 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 model
|
||||
|
||||
import (
|
||||
"github.com/google/uuid"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Manufacturers struct {
|
||||
ID uuid.UUID `sql:"primary_key"`
|
||||
Name string
|
||||
URL *string
|
||||
CreatedAt time.Time
|
||||
}
|
||||
22
backend/.gen/loading/public/model/powders.go
Normal file
22
backend/.gen/loading/public/model/powders.go
Normal file
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// 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 model
|
||||
|
||||
import (
|
||||
"github.com/google/uuid"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Powders struct {
|
||||
ID uuid.UUID `sql:"primary_key"`
|
||||
Name string
|
||||
Meta *string
|
||||
Photo *[]byte
|
||||
ManufacturerID uuid.UUID
|
||||
CreatedAt time.Time
|
||||
}
|
||||
22
backend/.gen/loading/public/model/primers.go
Normal file
22
backend/.gen/loading/public/model/primers.go
Normal file
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// 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 model
|
||||
|
||||
import (
|
||||
"github.com/google/uuid"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Primers struct {
|
||||
ID uuid.UUID `sql:"primary_key"`
|
||||
Name string
|
||||
Meta *string
|
||||
Photo *[]byte
|
||||
ManufacturerID uuid.UUID
|
||||
CreatedAt time.Time
|
||||
}
|
||||
13
backend/.gen/loading/public/model/schema_migrations.go
Normal file
13
backend/.gen/loading/public/model/schema_migrations.go
Normal file
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// 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 model
|
||||
|
||||
type SchemaMigrations struct {
|
||||
Version int64 `sql:"primary_key"`
|
||||
Dirty bool
|
||||
}
|
||||
99
backend/.gen/loading/public/table/bullets.go
Normal file
99
backend/.gen/loading/public/table/bullets.go
Normal file
@@ -0,0 +1,99 @@
|
||||
//
|
||||
// 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 Bullets = newBulletsTable("public", "bullets", "")
|
||||
|
||||
type bulletsTable struct {
|
||||
postgres.Table
|
||||
|
||||
// Columns
|
||||
ID postgres.ColumnString
|
||||
Name postgres.ColumnString
|
||||
Weight postgres.ColumnInteger
|
||||
Diameter postgres.ColumnInteger
|
||||
Meta postgres.ColumnString
|
||||
Photo postgres.ColumnBytea
|
||||
ManufacturerID postgres.ColumnString
|
||||
CreatedAt postgres.ColumnTimestamp
|
||||
|
||||
AllColumns postgres.ColumnList
|
||||
MutableColumns postgres.ColumnList
|
||||
DefaultColumns postgres.ColumnList
|
||||
}
|
||||
|
||||
type BulletsTable struct {
|
||||
bulletsTable
|
||||
|
||||
EXCLUDED bulletsTable
|
||||
}
|
||||
|
||||
// AS creates new BulletsTable with assigned alias
|
||||
func (a BulletsTable) AS(alias string) *BulletsTable {
|
||||
return newBulletsTable(a.SchemaName(), a.TableName(), alias)
|
||||
}
|
||||
|
||||
// Schema creates new BulletsTable with assigned schema name
|
||||
func (a BulletsTable) FromSchema(schemaName string) *BulletsTable {
|
||||
return newBulletsTable(schemaName, a.TableName(), a.Alias())
|
||||
}
|
||||
|
||||
// WithPrefix creates new BulletsTable with assigned table prefix
|
||||
func (a BulletsTable) WithPrefix(prefix string) *BulletsTable {
|
||||
return newBulletsTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
|
||||
}
|
||||
|
||||
// WithSuffix creates new BulletsTable with assigned table suffix
|
||||
func (a BulletsTable) WithSuffix(suffix string) *BulletsTable {
|
||||
return newBulletsTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
|
||||
}
|
||||
|
||||
func newBulletsTable(schemaName, tableName, alias string) *BulletsTable {
|
||||
return &BulletsTable{
|
||||
bulletsTable: newBulletsTableImpl(schemaName, tableName, alias),
|
||||
EXCLUDED: newBulletsTableImpl("", "excluded", ""),
|
||||
}
|
||||
}
|
||||
|
||||
func newBulletsTableImpl(schemaName, tableName, alias string) bulletsTable {
|
||||
var (
|
||||
IDColumn = postgres.StringColumn("id")
|
||||
NameColumn = postgres.StringColumn("name")
|
||||
WeightColumn = postgres.IntegerColumn("weight")
|
||||
DiameterColumn = postgres.IntegerColumn("diameter")
|
||||
MetaColumn = postgres.StringColumn("meta")
|
||||
PhotoColumn = postgres.ByteaColumn("photo")
|
||||
ManufacturerIDColumn = postgres.StringColumn("manufacturer_id")
|
||||
CreatedAtColumn = postgres.TimestampColumn("created_at")
|
||||
allColumns = postgres.ColumnList{IDColumn, NameColumn, WeightColumn, DiameterColumn, MetaColumn, PhotoColumn, ManufacturerIDColumn, CreatedAtColumn}
|
||||
mutableColumns = postgres.ColumnList{NameColumn, WeightColumn, DiameterColumn, MetaColumn, PhotoColumn, ManufacturerIDColumn, CreatedAtColumn}
|
||||
defaultColumns = postgres.ColumnList{IDColumn, CreatedAtColumn}
|
||||
)
|
||||
|
||||
return bulletsTable{
|
||||
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
|
||||
|
||||
//Columns
|
||||
ID: IDColumn,
|
||||
Name: NameColumn,
|
||||
Weight: WeightColumn,
|
||||
Diameter: DiameterColumn,
|
||||
Meta: MetaColumn,
|
||||
Photo: PhotoColumn,
|
||||
ManufacturerID: ManufacturerIDColumn,
|
||||
CreatedAt: CreatedAtColumn,
|
||||
|
||||
AllColumns: allColumns,
|
||||
MutableColumns: mutableColumns,
|
||||
DefaultColumns: defaultColumns,
|
||||
}
|
||||
}
|
||||
87
backend/.gen/loading/public/table/cartridges.go
Normal file
87
backend/.gen/loading/public/table/cartridges.go
Normal file
@@ -0,0 +1,87 @@
|
||||
//
|
||||
// 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 Cartridges = newCartridgesTable("public", "cartridges", "")
|
||||
|
||||
type cartridgesTable struct {
|
||||
postgres.Table
|
||||
|
||||
// Columns
|
||||
ID postgres.ColumnString
|
||||
Name postgres.ColumnString
|
||||
CreatedAt postgres.ColumnTimestamp
|
||||
Meta postgres.ColumnString
|
||||
|
||||
AllColumns postgres.ColumnList
|
||||
MutableColumns postgres.ColumnList
|
||||
DefaultColumns postgres.ColumnList
|
||||
}
|
||||
|
||||
type CartridgesTable struct {
|
||||
cartridgesTable
|
||||
|
||||
EXCLUDED cartridgesTable
|
||||
}
|
||||
|
||||
// AS creates new CartridgesTable with assigned alias
|
||||
func (a CartridgesTable) AS(alias string) *CartridgesTable {
|
||||
return newCartridgesTable(a.SchemaName(), a.TableName(), alias)
|
||||
}
|
||||
|
||||
// Schema creates new CartridgesTable with assigned schema name
|
||||
func (a CartridgesTable) FromSchema(schemaName string) *CartridgesTable {
|
||||
return newCartridgesTable(schemaName, a.TableName(), a.Alias())
|
||||
}
|
||||
|
||||
// WithPrefix creates new CartridgesTable with assigned table prefix
|
||||
func (a CartridgesTable) WithPrefix(prefix string) *CartridgesTable {
|
||||
return newCartridgesTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
|
||||
}
|
||||
|
||||
// WithSuffix creates new CartridgesTable with assigned table suffix
|
||||
func (a CartridgesTable) WithSuffix(suffix string) *CartridgesTable {
|
||||
return newCartridgesTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
|
||||
}
|
||||
|
||||
func newCartridgesTable(schemaName, tableName, alias string) *CartridgesTable {
|
||||
return &CartridgesTable{
|
||||
cartridgesTable: newCartridgesTableImpl(schemaName, tableName, alias),
|
||||
EXCLUDED: newCartridgesTableImpl("", "excluded", ""),
|
||||
}
|
||||
}
|
||||
|
||||
func newCartridgesTableImpl(schemaName, tableName, alias string) cartridgesTable {
|
||||
var (
|
||||
IDColumn = postgres.StringColumn("id")
|
||||
NameColumn = postgres.StringColumn("name")
|
||||
CreatedAtColumn = postgres.TimestampColumn("created_at")
|
||||
MetaColumn = postgres.StringColumn("meta")
|
||||
allColumns = postgres.ColumnList{IDColumn, NameColumn, CreatedAtColumn, MetaColumn}
|
||||
mutableColumns = postgres.ColumnList{NameColumn, CreatedAtColumn, MetaColumn}
|
||||
defaultColumns = postgres.ColumnList{IDColumn, CreatedAtColumn}
|
||||
)
|
||||
|
||||
return cartridgesTable{
|
||||
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
|
||||
|
||||
//Columns
|
||||
ID: IDColumn,
|
||||
Name: NameColumn,
|
||||
CreatedAt: CreatedAtColumn,
|
||||
Meta: MetaColumn,
|
||||
|
||||
AllColumns: allColumns,
|
||||
MutableColumns: mutableColumns,
|
||||
DefaultColumns: defaultColumns,
|
||||
}
|
||||
}
|
||||
105
backend/.gen/loading/public/table/loads.go
Normal file
105
backend/.gen/loading/public/table/loads.go
Normal file
@@ -0,0 +1,105 @@
|
||||
//
|
||||
// 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,
|
||||
}
|
||||
}
|
||||
87
backend/.gen/loading/public/table/manufacturers.go
Normal file
87
backend/.gen/loading/public/table/manufacturers.go
Normal file
@@ -0,0 +1,87 @@
|
||||
//
|
||||
// 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 Manufacturers = newManufacturersTable("public", "manufacturers", "")
|
||||
|
||||
type manufacturersTable struct {
|
||||
postgres.Table
|
||||
|
||||
// Columns
|
||||
ID postgres.ColumnString
|
||||
Name postgres.ColumnString
|
||||
URL postgres.ColumnString
|
||||
CreatedAt postgres.ColumnTimestamp
|
||||
|
||||
AllColumns postgres.ColumnList
|
||||
MutableColumns postgres.ColumnList
|
||||
DefaultColumns postgres.ColumnList
|
||||
}
|
||||
|
||||
type ManufacturersTable struct {
|
||||
manufacturersTable
|
||||
|
||||
EXCLUDED manufacturersTable
|
||||
}
|
||||
|
||||
// AS creates new ManufacturersTable with assigned alias
|
||||
func (a ManufacturersTable) AS(alias string) *ManufacturersTable {
|
||||
return newManufacturersTable(a.SchemaName(), a.TableName(), alias)
|
||||
}
|
||||
|
||||
// Schema creates new ManufacturersTable with assigned schema name
|
||||
func (a ManufacturersTable) FromSchema(schemaName string) *ManufacturersTable {
|
||||
return newManufacturersTable(schemaName, a.TableName(), a.Alias())
|
||||
}
|
||||
|
||||
// WithPrefix creates new ManufacturersTable with assigned table prefix
|
||||
func (a ManufacturersTable) WithPrefix(prefix string) *ManufacturersTable {
|
||||
return newManufacturersTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
|
||||
}
|
||||
|
||||
// WithSuffix creates new ManufacturersTable with assigned table suffix
|
||||
func (a ManufacturersTable) WithSuffix(suffix string) *ManufacturersTable {
|
||||
return newManufacturersTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
|
||||
}
|
||||
|
||||
func newManufacturersTable(schemaName, tableName, alias string) *ManufacturersTable {
|
||||
return &ManufacturersTable{
|
||||
manufacturersTable: newManufacturersTableImpl(schemaName, tableName, alias),
|
||||
EXCLUDED: newManufacturersTableImpl("", "excluded", ""),
|
||||
}
|
||||
}
|
||||
|
||||
func newManufacturersTableImpl(schemaName, tableName, alias string) manufacturersTable {
|
||||
var (
|
||||
IDColumn = postgres.StringColumn("id")
|
||||
NameColumn = postgres.StringColumn("name")
|
||||
URLColumn = postgres.StringColumn("url")
|
||||
CreatedAtColumn = postgres.TimestampColumn("created_at")
|
||||
allColumns = postgres.ColumnList{IDColumn, NameColumn, URLColumn, CreatedAtColumn}
|
||||
mutableColumns = postgres.ColumnList{NameColumn, URLColumn, CreatedAtColumn}
|
||||
defaultColumns = postgres.ColumnList{IDColumn, CreatedAtColumn}
|
||||
)
|
||||
|
||||
return manufacturersTable{
|
||||
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
|
||||
|
||||
//Columns
|
||||
ID: IDColumn,
|
||||
Name: NameColumn,
|
||||
URL: URLColumn,
|
||||
CreatedAt: CreatedAtColumn,
|
||||
|
||||
AllColumns: allColumns,
|
||||
MutableColumns: mutableColumns,
|
||||
DefaultColumns: defaultColumns,
|
||||
}
|
||||
}
|
||||
93
backend/.gen/loading/public/table/powders.go
Normal file
93
backend/.gen/loading/public/table/powders.go
Normal file
@@ -0,0 +1,93 @@
|
||||
//
|
||||
// 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 Powders = newPowdersTable("public", "powders", "")
|
||||
|
||||
type powdersTable struct {
|
||||
postgres.Table
|
||||
|
||||
// Columns
|
||||
ID postgres.ColumnString
|
||||
Name postgres.ColumnString
|
||||
Meta postgres.ColumnString
|
||||
Photo postgres.ColumnBytea
|
||||
ManufacturerID postgres.ColumnString
|
||||
CreatedAt postgres.ColumnTimestamp
|
||||
|
||||
AllColumns postgres.ColumnList
|
||||
MutableColumns postgres.ColumnList
|
||||
DefaultColumns postgres.ColumnList
|
||||
}
|
||||
|
||||
type PowdersTable struct {
|
||||
powdersTable
|
||||
|
||||
EXCLUDED powdersTable
|
||||
}
|
||||
|
||||
// AS creates new PowdersTable with assigned alias
|
||||
func (a PowdersTable) AS(alias string) *PowdersTable {
|
||||
return newPowdersTable(a.SchemaName(), a.TableName(), alias)
|
||||
}
|
||||
|
||||
// Schema creates new PowdersTable with assigned schema name
|
||||
func (a PowdersTable) FromSchema(schemaName string) *PowdersTable {
|
||||
return newPowdersTable(schemaName, a.TableName(), a.Alias())
|
||||
}
|
||||
|
||||
// WithPrefix creates new PowdersTable with assigned table prefix
|
||||
func (a PowdersTable) WithPrefix(prefix string) *PowdersTable {
|
||||
return newPowdersTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
|
||||
}
|
||||
|
||||
// WithSuffix creates new PowdersTable with assigned table suffix
|
||||
func (a PowdersTable) WithSuffix(suffix string) *PowdersTable {
|
||||
return newPowdersTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
|
||||
}
|
||||
|
||||
func newPowdersTable(schemaName, tableName, alias string) *PowdersTable {
|
||||
return &PowdersTable{
|
||||
powdersTable: newPowdersTableImpl(schemaName, tableName, alias),
|
||||
EXCLUDED: newPowdersTableImpl("", "excluded", ""),
|
||||
}
|
||||
}
|
||||
|
||||
func newPowdersTableImpl(schemaName, tableName, alias string) powdersTable {
|
||||
var (
|
||||
IDColumn = postgres.StringColumn("id")
|
||||
NameColumn = postgres.StringColumn("name")
|
||||
MetaColumn = postgres.StringColumn("meta")
|
||||
PhotoColumn = postgres.ByteaColumn("photo")
|
||||
ManufacturerIDColumn = postgres.StringColumn("manufacturer_id")
|
||||
CreatedAtColumn = postgres.TimestampColumn("created_at")
|
||||
allColumns = postgres.ColumnList{IDColumn, NameColumn, MetaColumn, PhotoColumn, ManufacturerIDColumn, CreatedAtColumn}
|
||||
mutableColumns = postgres.ColumnList{NameColumn, MetaColumn, PhotoColumn, ManufacturerIDColumn, CreatedAtColumn}
|
||||
defaultColumns = postgres.ColumnList{IDColumn, CreatedAtColumn}
|
||||
)
|
||||
|
||||
return powdersTable{
|
||||
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
|
||||
|
||||
//Columns
|
||||
ID: IDColumn,
|
||||
Name: NameColumn,
|
||||
Meta: MetaColumn,
|
||||
Photo: PhotoColumn,
|
||||
ManufacturerID: ManufacturerIDColumn,
|
||||
CreatedAt: CreatedAtColumn,
|
||||
|
||||
AllColumns: allColumns,
|
||||
MutableColumns: mutableColumns,
|
||||
DefaultColumns: defaultColumns,
|
||||
}
|
||||
}
|
||||
93
backend/.gen/loading/public/table/primers.go
Normal file
93
backend/.gen/loading/public/table/primers.go
Normal file
@@ -0,0 +1,93 @@
|
||||
//
|
||||
// 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 Primers = newPrimersTable("public", "primers", "")
|
||||
|
||||
type primersTable struct {
|
||||
postgres.Table
|
||||
|
||||
// Columns
|
||||
ID postgres.ColumnString
|
||||
Name postgres.ColumnString
|
||||
Meta postgres.ColumnString
|
||||
Photo postgres.ColumnBytea
|
||||
ManufacturerID postgres.ColumnString
|
||||
CreatedAt postgres.ColumnTimestamp
|
||||
|
||||
AllColumns postgres.ColumnList
|
||||
MutableColumns postgres.ColumnList
|
||||
DefaultColumns postgres.ColumnList
|
||||
}
|
||||
|
||||
type PrimersTable struct {
|
||||
primersTable
|
||||
|
||||
EXCLUDED primersTable
|
||||
}
|
||||
|
||||
// AS creates new PrimersTable with assigned alias
|
||||
func (a PrimersTable) AS(alias string) *PrimersTable {
|
||||
return newPrimersTable(a.SchemaName(), a.TableName(), alias)
|
||||
}
|
||||
|
||||
// Schema creates new PrimersTable with assigned schema name
|
||||
func (a PrimersTable) FromSchema(schemaName string) *PrimersTable {
|
||||
return newPrimersTable(schemaName, a.TableName(), a.Alias())
|
||||
}
|
||||
|
||||
// WithPrefix creates new PrimersTable with assigned table prefix
|
||||
func (a PrimersTable) WithPrefix(prefix string) *PrimersTable {
|
||||
return newPrimersTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
|
||||
}
|
||||
|
||||
// WithSuffix creates new PrimersTable with assigned table suffix
|
||||
func (a PrimersTable) WithSuffix(suffix string) *PrimersTable {
|
||||
return newPrimersTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
|
||||
}
|
||||
|
||||
func newPrimersTable(schemaName, tableName, alias string) *PrimersTable {
|
||||
return &PrimersTable{
|
||||
primersTable: newPrimersTableImpl(schemaName, tableName, alias),
|
||||
EXCLUDED: newPrimersTableImpl("", "excluded", ""),
|
||||
}
|
||||
}
|
||||
|
||||
func newPrimersTableImpl(schemaName, tableName, alias string) primersTable {
|
||||
var (
|
||||
IDColumn = postgres.StringColumn("id")
|
||||
NameColumn = postgres.StringColumn("name")
|
||||
MetaColumn = postgres.StringColumn("meta")
|
||||
PhotoColumn = postgres.ByteaColumn("photo")
|
||||
ManufacturerIDColumn = postgres.StringColumn("manufacturer_id")
|
||||
CreatedAtColumn = postgres.TimestampColumn("created_at")
|
||||
allColumns = postgres.ColumnList{IDColumn, NameColumn, MetaColumn, PhotoColumn, ManufacturerIDColumn, CreatedAtColumn}
|
||||
mutableColumns = postgres.ColumnList{NameColumn, MetaColumn, PhotoColumn, ManufacturerIDColumn, CreatedAtColumn}
|
||||
defaultColumns = postgres.ColumnList{IDColumn, CreatedAtColumn}
|
||||
)
|
||||
|
||||
return primersTable{
|
||||
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
|
||||
|
||||
//Columns
|
||||
ID: IDColumn,
|
||||
Name: NameColumn,
|
||||
Meta: MetaColumn,
|
||||
Photo: PhotoColumn,
|
||||
ManufacturerID: ManufacturerIDColumn,
|
||||
CreatedAt: CreatedAtColumn,
|
||||
|
||||
AllColumns: allColumns,
|
||||
MutableColumns: mutableColumns,
|
||||
DefaultColumns: defaultColumns,
|
||||
}
|
||||
}
|
||||
81
backend/.gen/loading/public/table/schema_migrations.go
Normal file
81
backend/.gen/loading/public/table/schema_migrations.go
Normal file
@@ -0,0 +1,81 @@
|
||||
//
|
||||
// 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 SchemaMigrations = newSchemaMigrationsTable("public", "schema_migrations", "")
|
||||
|
||||
type schemaMigrationsTable struct {
|
||||
postgres.Table
|
||||
|
||||
// Columns
|
||||
Version postgres.ColumnInteger
|
||||
Dirty postgres.ColumnBool
|
||||
|
||||
AllColumns postgres.ColumnList
|
||||
MutableColumns postgres.ColumnList
|
||||
DefaultColumns postgres.ColumnList
|
||||
}
|
||||
|
||||
type SchemaMigrationsTable struct {
|
||||
schemaMigrationsTable
|
||||
|
||||
EXCLUDED schemaMigrationsTable
|
||||
}
|
||||
|
||||
// AS creates new SchemaMigrationsTable with assigned alias
|
||||
func (a SchemaMigrationsTable) AS(alias string) *SchemaMigrationsTable {
|
||||
return newSchemaMigrationsTable(a.SchemaName(), a.TableName(), alias)
|
||||
}
|
||||
|
||||
// Schema creates new SchemaMigrationsTable with assigned schema name
|
||||
func (a SchemaMigrationsTable) FromSchema(schemaName string) *SchemaMigrationsTable {
|
||||
return newSchemaMigrationsTable(schemaName, a.TableName(), a.Alias())
|
||||
}
|
||||
|
||||
// WithPrefix creates new SchemaMigrationsTable with assigned table prefix
|
||||
func (a SchemaMigrationsTable) WithPrefix(prefix string) *SchemaMigrationsTable {
|
||||
return newSchemaMigrationsTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
|
||||
}
|
||||
|
||||
// WithSuffix creates new SchemaMigrationsTable with assigned table suffix
|
||||
func (a SchemaMigrationsTable) WithSuffix(suffix string) *SchemaMigrationsTable {
|
||||
return newSchemaMigrationsTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
|
||||
}
|
||||
|
||||
func newSchemaMigrationsTable(schemaName, tableName, alias string) *SchemaMigrationsTable {
|
||||
return &SchemaMigrationsTable{
|
||||
schemaMigrationsTable: newSchemaMigrationsTableImpl(schemaName, tableName, alias),
|
||||
EXCLUDED: newSchemaMigrationsTableImpl("", "excluded", ""),
|
||||
}
|
||||
}
|
||||
|
||||
func newSchemaMigrationsTableImpl(schemaName, tableName, alias string) schemaMigrationsTable {
|
||||
var (
|
||||
VersionColumn = postgres.IntegerColumn("version")
|
||||
DirtyColumn = postgres.BoolColumn("dirty")
|
||||
allColumns = postgres.ColumnList{VersionColumn, DirtyColumn}
|
||||
mutableColumns = postgres.ColumnList{DirtyColumn}
|
||||
defaultColumns = postgres.ColumnList{}
|
||||
)
|
||||
|
||||
return schemaMigrationsTable{
|
||||
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
|
||||
|
||||
//Columns
|
||||
Version: VersionColumn,
|
||||
Dirty: DirtyColumn,
|
||||
|
||||
AllColumns: allColumns,
|
||||
MutableColumns: mutableColumns,
|
||||
DefaultColumns: defaultColumns,
|
||||
}
|
||||
}
|
||||
20
backend/.gen/loading/public/table/table_use_schema.go
Normal file
20
backend/.gen/loading/public/table/table_use_schema.go
Normal file
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// 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
|
||||
|
||||
// UseSchema sets a new schema name for all generated table SQL builder types. It is recommended to invoke
|
||||
// this method only once at the beginning of the program.
|
||||
func UseSchema(schema string) {
|
||||
Bullets = Bullets.FromSchema(schema)
|
||||
Cartridges = Cartridges.FromSchema(schema)
|
||||
Loads = Loads.FromSchema(schema)
|
||||
Manufacturers = Manufacturers.FromSchema(schema)
|
||||
Powders = Powders.FromSchema(schema)
|
||||
Primers = Primers.FromSchema(schema)
|
||||
SchemaMigrations = SchemaMigrations.FromSchema(schema)
|
||||
}
|
||||
Reference in New Issue
Block a user