Row and Array Comparisons (IN, NOT_IN).
This commit is contained in:
parent
d69c67569a
commit
384c0c67f5
19 changed files with 170 additions and 231 deletions
|
|
@ -2,6 +2,14 @@ package sqlbuilder
|
|||
|
||||
import "testing"
|
||||
|
||||
func TestOperatorNOT(t *testing.T) {
|
||||
notExpression := NOT(Int(2).EQ(Int(1)))
|
||||
|
||||
assertExpressionSerialize(t, notExpression, "NOT ($1 = $2)", int64(2), int64(1))
|
||||
assertProjectionSerialize(t, notExpression.AS("alias_not_expression"), `NOT ($1 = $2) AS "alias_not_expression"`, int64(2), int64(1))
|
||||
assertExpressionSerialize(t, notExpression.AND(Int(4).EQ(Int(5))), `(NOT ($1 = $2) AND ($3 = $4))`, int64(2), int64(1), int64(4), int64(5))
|
||||
}
|
||||
|
||||
func TestCase1(t *testing.T) {
|
||||
query := CASE().
|
||||
WHEN(table3Col1.EQ(Int(1))).THEN(table3Col1.ADD(Int(1))).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue