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

115 lines
4.2 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/v2/postgres"
2019-07-17 13:22:14 +02:00
)
var Film = newFilmTable("dvds", "film", "")
2019-07-17 13:22:14 +02:00
2020-05-31 10:42:55 +02:00
type filmTable 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
FilmID postgres.ColumnInteger
Title postgres.ColumnString
Description postgres.ColumnString
ReleaseYear postgres.ColumnInteger
LanguageID postgres.ColumnInteger
RentalDuration postgres.ColumnInteger
RentalRate postgres.ColumnFloat
Length postgres.ColumnInteger
ReplacementCost postgres.ColumnFloat
Rating postgres.ColumnString
LastUpdate postgres.ColumnTimestamp
SpecialFeatures postgres.ColumnStringArray
2019-08-08 12:02:32 +02:00
Fulltext postgres.ColumnString
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 FilmTable struct {
filmTable
EXCLUDED filmTable
}
// AS creates new FilmTable with assigned alias
func (a FilmTable) AS(alias string) *FilmTable {
return newFilmTable(a.SchemaName(), a.TableName(), alias)
2019-07-17 13:22:14 +02:00
}
// Schema creates new FilmTable with assigned schema name
func (a FilmTable) FromSchema(schemaName string) *FilmTable {
return newFilmTable(schemaName, a.TableName(), a.Alias())
}
// WithPrefix creates new FilmTable with assigned table prefix
func (a FilmTable) WithPrefix(prefix string) *FilmTable {
return newFilmTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
}
// WithSuffix creates new FilmTable with assigned table suffix
func (a FilmTable) WithSuffix(suffix string) *FilmTable {
return newFilmTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
}
func newFilmTable(schemaName, tableName, alias string) *FilmTable {
2020-05-31 10:42:55 +02:00
return &FilmTable{
filmTable: newFilmTableImpl(schemaName, tableName, alias),
EXCLUDED: newFilmTableImpl("", "excluded", ""),
2020-05-31 10:42:55 +02:00
}
}
func newFilmTableImpl(schemaName, tableName, alias string) filmTable {
2019-07-17 13:22:14 +02:00
var (
2019-08-08 12:02:32 +02:00
FilmIDColumn = postgres.IntegerColumn("film_id")
TitleColumn = postgres.StringColumn("title")
DescriptionColumn = postgres.StringColumn("description")
ReleaseYearColumn = postgres.IntegerColumn("release_year")
LanguageIDColumn = postgres.IntegerColumn("language_id")
RentalDurationColumn = postgres.IntegerColumn("rental_duration")
RentalRateColumn = postgres.FloatColumn("rental_rate")
LengthColumn = postgres.IntegerColumn("length")
ReplacementCostColumn = postgres.FloatColumn("replacement_cost")
RatingColumn = postgres.StringColumn("rating")
LastUpdateColumn = postgres.TimestampColumn("last_update")
SpecialFeaturesColumn = postgres.StringArrayColumn("special_features")
2019-08-08 12:02:32 +02:00
FulltextColumn = postgres.StringColumn("fulltext")
2020-05-31 10:42:55 +02:00
allColumns = postgres.ColumnList{FilmIDColumn, TitleColumn, DescriptionColumn, ReleaseYearColumn, LanguageIDColumn, RentalDurationColumn, RentalRateColumn, LengthColumn, ReplacementCostColumn, RatingColumn, LastUpdateColumn, SpecialFeaturesColumn, FulltextColumn}
mutableColumns = postgres.ColumnList{TitleColumn, DescriptionColumn, ReleaseYearColumn, LanguageIDColumn, RentalDurationColumn, RentalRateColumn, LengthColumn, ReplacementCostColumn, RatingColumn, LastUpdateColumn, SpecialFeaturesColumn, FulltextColumn}
defaultColumns = postgres.ColumnList{FilmIDColumn, RentalDurationColumn, RentalRateColumn, ReplacementCostColumn, RatingColumn, LastUpdateColumn}
2019-07-17 13:22:14 +02:00
)
2020-05-31 10:42:55 +02:00
return filmTable{
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
2019-07-17 13:22:14 +02:00
//Columns
FilmID: FilmIDColumn,
Title: TitleColumn,
Description: DescriptionColumn,
ReleaseYear: ReleaseYearColumn,
LanguageID: LanguageIDColumn,
RentalDuration: RentalDurationColumn,
RentalRate: RentalRateColumn,
Length: LengthColumn,
ReplacementCost: ReplacementCostColumn,
Rating: RatingColumn,
LastUpdate: LastUpdateColumn,
SpecialFeatures: SpecialFeaturesColumn,
Fulltext: FulltextColumn,
2020-05-31 10:42:55 +02:00
AllColumns: allColumns,
MutableColumns: mutableColumns,
DefaultColumns: defaultColumns,
2019-07-17 13:22:14 +02:00
}
}