dialect/sql: change boolean operators wrapping (#678)

The reason is to parentheses only when it's necessary.
This commit is contained in:
Ariel Mashraki
2020-08-20 10:08:31 +03:00
committed by GitHub
parent ea97f3a6e0
commit b18716931d
9 changed files with 174 additions and 134 deletions

View File

@@ -1214,9 +1214,9 @@ func matchIDs(column1 string, pk1 []driver.Value, column2 string, pk2 []driver.V
if len(pk2) > 1 {
// Use "IN" predicate instead of list of "OR"
// in case of more than on nodes to connect.
return p.And().InValues(column2, pk2...)
return sql.And(p, sql.InValues(column2, pk2...))
}
return p.And().EQ(column2, pk2[0])
return sql.And(p, sql.EQ(column2, pk2[0]))
}
// cartesian product of 2 id sets.