jet/examples/quick-start/.gen/jetdb/dvds/table/film_actor.go

85 lines
2.4 KiB
Go
Raw Normal View History

2019-07-17 13:22:14 +02:00
//
// 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 (
"source.gleipnir.technology/Gleipnir/jet/postgres"
2019-07-17 13:22:14 +02:00
)
var FilmActor = newFilmActorTable("dvds", "film_actor", "")
2019-07-17 13:22:14 +02:00
2020-05-31 10:42:55 +02:00
type filmActorTable struct {
2019-08-08 12:02:32 +02:00
postgres.Table
2019-07-17 13:22:14 +02:00
// Columns
2019-08-08 12:02:32 +02:00
ActorID postgres.ColumnInteger
FilmID postgres.ColumnInteger
LastUpdate postgres.ColumnTimestamp
2019-07-17 13:22:14 +02:00
AllColumns postgres.ColumnList
MutableColumns postgres.ColumnList
DefaultColumns postgres.ColumnList
2019-07-17 13:22:14 +02:00
}
2020-05-31 10:42:55 +02:00
type FilmActorTable struct {
filmActorTable
EXCLUDED filmActorTable
}
// AS creates new FilmActorTable with assigned alias
func (a FilmActorTable) AS(alias string) *FilmActorTable {
return newFilmActorTable(a.SchemaName(), a.TableName(), alias)
2019-07-17 13:22:14 +02:00
}
// Schema creates new FilmActorTable with assigned schema name
func (a FilmActorTable) FromSchema(schemaName string) *FilmActorTable {
return newFilmActorTable(schemaName, a.TableName(), a.Alias())
}
// WithPrefix creates new FilmActorTable with assigned table prefix
func (a FilmActorTable) WithPrefix(prefix string) *FilmActorTable {
return newFilmActorTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
}
// WithSuffix creates new FilmActorTable with assigned table suffix
func (a FilmActorTable) WithSuffix(suffix string) *FilmActorTable {
return newFilmActorTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
}
func newFilmActorTable(schemaName, tableName, alias string) *FilmActorTable {
2020-05-31 10:42:55 +02:00
return &FilmActorTable{
filmActorTable: newFilmActorTableImpl(schemaName, tableName, alias),
EXCLUDED: newFilmActorTableImpl("", "excluded", ""),
2020-05-31 10:42:55 +02:00
}
}
func newFilmActorTableImpl(schemaName, tableName, alias string) filmActorTable {
2019-07-17 13:22:14 +02:00
var (
2019-08-08 12:02:32 +02:00
ActorIDColumn = postgres.IntegerColumn("actor_id")
FilmIDColumn = postgres.IntegerColumn("film_id")
LastUpdateColumn = postgres.TimestampColumn("last_update")
2020-05-31 10:42:55 +02:00
allColumns = postgres.ColumnList{ActorIDColumn, FilmIDColumn, LastUpdateColumn}
mutableColumns = postgres.ColumnList{LastUpdateColumn}
defaultColumns = postgres.ColumnList{LastUpdateColumn}
2019-07-17 13:22:14 +02:00
)
2020-05-31 10:42:55 +02:00
return filmActorTable{
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
2019-07-17 13:22:14 +02:00
//Columns
ActorID: ActorIDColumn,
FilmID: FilmIDColumn,
LastUpdate: LastUpdateColumn,
2020-05-31 10:42:55 +02:00
AllColumns: allColumns,
MutableColumns: mutableColumns,
DefaultColumns: defaultColumns,
2019-07-17 13:22:14 +02:00
}
}