qb: tuples now returns the correct names

The names are auto generated in the form param_0, param_1, ...
This commit is contained in:
Henrik Johansson
2019-05-14 10:58:37 +02:00
committed by Michal Matczuk
parent 219bceab51
commit 1fda6f1e29
6 changed files with 25 additions and 18 deletions

View File

@@ -69,13 +69,13 @@ func TestSelectBuilder(t *testing.T) {
{
B: Select("cycling.cyclist_name").Where(EqTuple("id", 2), Gt("firstname")),
S: "SELECT * FROM cycling.cyclist_name WHERE id=(?,?) AND firstname>? ",
N: []string{"id", "firstname"},
N: []string{"id_0", "id_1", "firstname"},
},
// Add WHERE with only tuples
{
B: Select("cycling.cyclist_name").Where(EqTuple("id", 2), GtTuple("firstname", 2)),
S: "SELECT * FROM cycling.cyclist_name WHERE id=(?,?) AND firstname>(?,?) ",
N: []string{"id", "firstname"},
N: []string{"id_0", "id_1", "firstname_0", "firstname_1"},
},
// Add GROUP BY
{