[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

@ -5,11 +5,8 @@ import "github.com/go-jet/jet/internal/jet"
// Column is common column interface for all types of columns.
type Column = jet.ColumnExpression
// IColumnList is used to store list of columns for later reuse as projection or column list for UPDATE and INSERT statement.
type IColumnList = jet.IColumnList
// ColumnList function returns list of columns that be used as projection or column list for UPDATE and INSERT statement.
var ColumnList = jet.ColumnList
type ColumnList = jet.ColumnList
// ColumnBool is interface for SQL boolean columns.
type ColumnBool = jet.ColumnBool

View file

@ -26,7 +26,9 @@ INSERT INTO db.table1 (col1) VALUES
}
func TestInsertWithColumnList(t *testing.T) {
columnList := ColumnList(table3ColInt, table3StrCol)
columnList := ColumnList{table3ColInt}
columnList = append(columnList, table3StrCol)
assertStatementSql(t, table3.INSERT(columnList).VALUES(1, 3), `
INSERT INTO db.table3 (col_int, col2) VALUES

View file

@ -10,7 +10,7 @@ func TestInvalidSelect(t *testing.T) {
}
func TestSelectColumnList(t *testing.T) {
columnList := ColumnList(table2ColInt, table2ColFloat, table3ColInt)
columnList := ColumnList{table2ColInt, table2ColFloat, table3ColInt}
assertStatementSql(t, SELECT(columnList).FROM(table2), `
SELECT table2.col_int AS "table2.col_int",