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
|
|
@ -269,7 +269,7 @@ func TestScanToNestedStruct(t *testing.T) {
|
|||
query := Inventory.
|
||||
INNER_JOIN(Film, Inventory.FilmID.EQ(Film.FilmID)).
|
||||
INNER_JOIN(Store, Inventory.StoreID.EQ(Store.StoreID)).
|
||||
SELECT(Inventory.AllColumns, Film.AllColumns, Store.AllColumns, Literal("").AS("actor.first_name")).
|
||||
SELECT(Inventory.AllColumns, Film.AllColumns, Store.AllColumns, String("").AS("actor.first_name")).
|
||||
WHERE(Inventory.InventoryID.EQ(Int(1)))
|
||||
|
||||
dest := struct {
|
||||
|
|
|
|||
|
|
@ -1086,10 +1086,10 @@ LIMIT 20;
|
|||
`
|
||||
query := Payment.SELECT(
|
||||
CASE(Payment.StaffID).
|
||||
WHEN(Int(1)).THEN(Literal("ONE")).
|
||||
WHEN(Int(2)).THEN(Literal("TWO")).
|
||||
WHEN(Int(3)).THEN(Literal("THREE")).
|
||||
ELSE(Literal("OTHER")).AS("staff_id_num"),
|
||||
WHEN(Int(1)).THEN(String("ONE")).
|
||||
WHEN(Int(2)).THEN(String("TWO")).
|
||||
WHEN(Int(3)).THEN(String("THREE")).
|
||||
ELSE(String("OTHER")).AS("staff_id_num"),
|
||||
).
|
||||
ORDER_BY(Payment.PaymentID.ASC()).
|
||||
LIMIT(20)
|
||||
|
|
|
|||
|
|
@ -29,6 +29,10 @@ func TestExpressionOperators(t *testing.T) {
|
|||
query := AllTypes.SELECT(
|
||||
AllTypes.Integer.IS_NULL(),
|
||||
AllTypes.Timestamp.IS_NOT_NULL(),
|
||||
AllTypes.SmallintPtr.IN(Int(11), Int(22), NULL),
|
||||
AllTypes.SmallintPtr.IN(AllTypes.SELECT(AllTypes.IntegerPtr)),
|
||||
AllTypes.SmallintPtr.NOT_IN(Int(11), Int(22), NULL),
|
||||
AllTypes.SmallintPtr.NOT_IN(AllTypes.SELECT(AllTypes.IntegerPtr)),
|
||||
|
||||
String("TRUE").CAST_TO_BOOL(),
|
||||
String("111").CAST_TO_INTEGER(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue