[Breakable] ColumnList is reverted to be a slice.

ColumnList(...) -> ColumnList{...}
IColumnList is removed.
This commit is contained in:
go-jet 2019-09-26 12:31:03 +02:00
parent 4f86a77b2d
commit 799737d602
30 changed files with 217 additions and 105 deletions

View file

@ -137,8 +137,8 @@ type ActorTable struct {
LastName mysql.ColumnString
LastUpdate mysql.ColumnTimestamp
AllColumns mysql.IColumnList
MutableColumns mysql.IColumnList
AllColumns mysql.ColumnList
MutableColumns mysql.ColumnList
}
// creates new ActorTable with assigned alias
@ -167,8 +167,8 @@ func newActorTable() *ActorTable {
LastName: LastNameColumn,
LastUpdate: LastUpdateColumn,
AllColumns: mysql.ColumnList(ActorIDColumn, FirstNameColumn, LastNameColumn, LastUpdateColumn),
MutableColumns: mysql.ColumnList(FirstNameColumn, LastNameColumn, LastUpdateColumn),
AllColumns: mysql.ColumnList{ActorIDColumn, FirstNameColumn, LastNameColumn, LastUpdateColumn},
MutableColumns: mysql.ColumnList{FirstNameColumn, LastNameColumn, LastUpdateColumn},
}
}
`
@ -206,8 +206,8 @@ type ActorInfoTable struct {
LastName mysql.ColumnString
FilmInfo mysql.ColumnString
AllColumns mysql.IColumnList
MutableColumns mysql.IColumnList
AllColumns mysql.ColumnList
MutableColumns mysql.ColumnList
}
// creates new ActorInfoTable with assigned alias
@ -236,8 +236,8 @@ func newActorInfoTable() *ActorInfoTable {
LastName: LastNameColumn,
FilmInfo: FilmInfoColumn,
AllColumns: mysql.ColumnList(ActorIDColumn, FirstNameColumn, LastNameColumn, FilmInfoColumn),
MutableColumns: mysql.ColumnList(ActorIDColumn, FirstNameColumn, LastNameColumn, FilmInfoColumn),
AllColumns: mysql.ColumnList{ActorIDColumn, FirstNameColumn, LastNameColumn, FilmInfoColumn},
MutableColumns: mysql.ColumnList{ActorIDColumn, FirstNameColumn, LastNameColumn, FilmInfoColumn},
}
}
`

View file

@ -118,7 +118,7 @@ func TestUpdateWithModelDataAndPredefinedColumnList(t *testing.T) {
Name: "DuckDuckGo",
}
updateColumnList := ColumnList(Link.Description, Link.Name, Link.URL)
updateColumnList := ColumnList{Link.Description, Link.Name, Link.URL}
stmt := Link.
UPDATE(updateColumnList).

View file

@ -171,8 +171,8 @@ type ActorTable struct {
LastName postgres.ColumnString
LastUpdate postgres.ColumnTimestamp
AllColumns postgres.IColumnList
MutableColumns postgres.IColumnList
AllColumns postgres.ColumnList
MutableColumns postgres.ColumnList
}
// creates new ActorTable with assigned alias
@ -201,8 +201,8 @@ func newActorTable() *ActorTable {
LastName: LastNameColumn,
LastUpdate: LastUpdateColumn,
AllColumns: postgres.ColumnList(ActorIDColumn, FirstNameColumn, LastNameColumn, LastUpdateColumn),
MutableColumns: postgres.ColumnList(FirstNameColumn, LastNameColumn, LastUpdateColumn),
AllColumns: postgres.ColumnList{ActorIDColumn, FirstNameColumn, LastNameColumn, LastUpdateColumn},
MutableColumns: postgres.ColumnList{FirstNameColumn, LastNameColumn, LastUpdateColumn},
}
}
`
@ -240,8 +240,8 @@ type ActorInfoTable struct {
LastName postgres.ColumnString
FilmInfo postgres.ColumnString
AllColumns postgres.IColumnList
MutableColumns postgres.IColumnList
AllColumns postgres.ColumnList
MutableColumns postgres.ColumnList
}
// creates new ActorInfoTable with assigned alias
@ -270,8 +270,8 @@ func newActorInfoTable() *ActorInfoTable {
LastName: LastNameColumn,
FilmInfo: FilmInfoColumn,
AllColumns: postgres.ColumnList(ActorIDColumn, FirstNameColumn, LastNameColumn, FilmInfoColumn),
MutableColumns: postgres.ColumnList(ActorIDColumn, FirstNameColumn, LastNameColumn, FilmInfoColumn),
AllColumns: postgres.ColumnList{ActorIDColumn, FirstNameColumn, LastNameColumn, FilmInfoColumn},
MutableColumns: postgres.ColumnList{ActorIDColumn, FirstNameColumn, LastNameColumn, FilmInfoColumn},
}
}
`

View file

@ -191,7 +191,7 @@ func TestUpdateWithModelDataAndPredefinedColumnList(t *testing.T) {
Name: "DuckDuckGo",
}
updateColumnList := ColumnList(Link.Description, Link.Name, Link.URL)
updateColumnList := ColumnList{Link.Description, Link.Name, Link.URL}
stmt := Link.
UPDATE(updateColumnList).