From 8430785ae723e605d0978a3fd7cab6bf29fcd4ec Mon Sep 17 00:00:00 2001 From: parsonsmatt Date: Thu, 20 May 2021 10:30:12 -0600 Subject: [PATCH] test case --- test/Common/Test.hs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/Common/Test.hs b/test/Common/Test.hs index f7c4b09..47491ef 100644 --- a/test/Common/Test.hs +++ b/test/Common/Test.hs @@ -1466,6 +1466,21 @@ testUpdate run = describe "update" $ do , (Entity p1k p1, Value 3) , (Entity p3k p3, Value 7) ] + it "GROUP BY works with composite primary key" $ run $ do + p1k <- insert $ Point 1 2 "asdf" + p2k <- insert $ Point 2 3 "asdf" + ret <- + selectRethrowingQuery $ + from $ \point -> do + where_ $ point ^. PointName ==. val "asdf" + groupBy (point ^. PointId) + pure (point ^. PointId) + liftIO $ do + ret `shouldMatchList` + map Value [p1k, p2k] + + + it "GROUP BY works with COUNT and InnerJoin" $ run $ do l1k <- insert l1 l3k <- insert l3