Update quick start example.
This commit is contained in:
parent
196989ab68
commit
0183117b72
18 changed files with 184 additions and 96 deletions
|
|
@ -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 ActorInfo = newActorInfoTable()
|
||||
|
||||
type ActorInfoTable struct {
|
||||
type actorInfoTable struct {
|
||||
postgres.Table
|
||||
|
||||
//Columns
|
||||
|
|
@ -27,25 +26,38 @@ type ActorInfoTable struct {
|
|||
MutableColumns postgres.ColumnList
|
||||
}
|
||||
|
||||
// creates new ActorInfoTable with assigned alias
|
||||
type ActorInfoTable struct {
|
||||
actorInfoTable
|
||||
|
||||
EXCLUDED actorInfoTable
|
||||
}
|
||||
|
||||
// AS creates new ActorInfoTable with assigned alias
|
||||
func (a *ActorInfoTable) AS(alias string) *ActorInfoTable {
|
||||
aliasTable := newActorInfoTable()
|
||||
|
||||
aliasTable.Table.AS(alias)
|
||||
|
||||
return aliasTable
|
||||
}
|
||||
|
||||
func newActorInfoTable() *ActorInfoTable {
|
||||
return &ActorInfoTable{
|
||||
actorInfoTable: newActorInfoTableImpl("dvds", "actor_info"),
|
||||
EXCLUDED: newActorInfoTableImpl("", "excluded"),
|
||||
}
|
||||
}
|
||||
|
||||
func newActorInfoTableImpl(schemaName, tableName string) actorInfoTable {
|
||||
var (
|
||||
ActorIDColumn = postgres.IntegerColumn("actor_id")
|
||||
FirstNameColumn = postgres.StringColumn("first_name")
|
||||
LastNameColumn = postgres.StringColumn("last_name")
|
||||
FilmInfoColumn = postgres.StringColumn("film_info")
|
||||
allColumns = postgres.ColumnList{ActorIDColumn, FirstNameColumn, LastNameColumn, FilmInfoColumn}
|
||||
mutableColumns = postgres.ColumnList{ActorIDColumn, FirstNameColumn, LastNameColumn, FilmInfoColumn}
|
||||
)
|
||||
|
||||
return &ActorInfoTable{
|
||||
Table: postgres.NewTable("dvds", "actor_info", ActorIDColumn, FirstNameColumn, LastNameColumn, FilmInfoColumn),
|
||||
return actorInfoTable{
|
||||
Table: postgres.NewTable(schemaName, tableName, allColumns...),
|
||||
|
||||
//Columns
|
||||
ActorID: ActorIDColumn,
|
||||
|
|
@ -53,7 +65,7 @@ func newActorInfoTable() *ActorInfoTable {
|
|||
LastName: LastNameColumn,
|
||||
FilmInfo: FilmInfoColumn,
|
||||
|
||||
AllColumns: postgres.ColumnList{ActorIDColumn, FirstNameColumn, LastNameColumn, FilmInfoColumn},
|
||||
MutableColumns: postgres.ColumnList{ActorIDColumn, FirstNameColumn, LastNameColumn, FilmInfoColumn},
|
||||
AllColumns: allColumns,
|
||||
MutableColumns: mutableColumns,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue