Update quick start example.

This commit is contained in:
go-jet 2020-05-31 10:42:55 +02:00
parent 196989ab68
commit 0183117b72
18 changed files with 184 additions and 96 deletions

View file

@ -1,6 +1,5 @@
//
// Code generated by go-jet DO NOT EDIT.
// Generated at Thursday, 26-Sep-19 12:02:13 CEST
//
// WARNING: Changes to this file may cause incorrect behavior
// and will be lost if the code is regenerated
@ -14,7 +13,7 @@ import (
var FilmActor = newFilmActorTable()
type FilmActorTable struct {
type filmActorTable struct {
postgres.Table
//Columns
@ -26,31 +25,44 @@ type FilmActorTable struct {
MutableColumns postgres.ColumnList
}
// creates new FilmActorTable with assigned alias
type FilmActorTable struct {
filmActorTable
EXCLUDED filmActorTable
}
// AS creates new FilmActorTable with assigned alias
func (a *FilmActorTable) AS(alias string) *FilmActorTable {
aliasTable := newFilmActorTable()
aliasTable.Table.AS(alias)
return aliasTable
}
func newFilmActorTable() *FilmActorTable {
return &FilmActorTable{
filmActorTable: newFilmActorTableImpl("dvds", "film_actor"),
EXCLUDED: newFilmActorTableImpl("", "excluded"),
}
}
func newFilmActorTableImpl(schemaName, tableName string) filmActorTable {
var (
ActorIDColumn = postgres.IntegerColumn("actor_id")
FilmIDColumn = postgres.IntegerColumn("film_id")
LastUpdateColumn = postgres.TimestampColumn("last_update")
allColumns = postgres.ColumnList{ActorIDColumn, FilmIDColumn, LastUpdateColumn}
mutableColumns = postgres.ColumnList{LastUpdateColumn}
)
return &FilmActorTable{
Table: postgres.NewTable("dvds", "film_actor", ActorIDColumn, FilmIDColumn, LastUpdateColumn),
return filmActorTable{
Table: postgres.NewTable(schemaName, tableName, allColumns...),
//Columns
ActorID: ActorIDColumn,
FilmID: FilmIDColumn,
LastUpdate: LastUpdateColumn,
AllColumns: postgres.ColumnList{ActorIDColumn, FilmIDColumn, LastUpdateColumn},
MutableColumns: postgres.ColumnList{LastUpdateColumn},
AllColumns: allColumns,
MutableColumns: mutableColumns,
}
}