packages feed

esqueleto 3.5.2.0 → 3.5.2.1

raw patch · 4 files changed

+25/−2 lines, 4 filesnew-uploaderPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

changelog.md view
@@ -1,3 +1,9 @@+3.5.2.1+=======+- @cdparks+  - [#273](https://github.com/bitemyapp/esqueleto/pull/273)+        - Avoid generating an empty list as the left operand to `NOT IN`.+ 3.5.2.0 ======= - @ivanbakel
esqueleto.cabal view
@@ -1,7 +1,7 @@ cabal-version: 1.12  name:           esqueleto-version:        3.5.2.0+version:        3.5.2.1 synopsis:       Type-safe EDSL for SQL queries on persistent backends. description:    @esqueleto@ is a bare bones, type-safe EDSL for SQL queries that works with unmodified @persistent@ SQL backends.  Its language closely resembles SQL, so you don't have to learn new concepts, just new syntax, and it's fairly easy to predict the generated SQL and optimize it for your backend. Most kinds of errors committed when writing SQL are caught as compile-time errors---although it is possible to write type-checked @esqueleto@ queries that fail at runtime.                 .
src/Database/Esqueleto/Internal/Internal.hs view
@@ -939,7 +939,11 @@     ERaw noMeta $ \_ info ->         let (b1, vals1) = v Parens info             (b2, vals2) = list Parens info-        in (b1 <> " NOT IN " <> b2, vals1 <> vals2)+        in+        if b2 == "()" then+            ("TRUE", [])+        else+            (b1 <> " NOT IN " <> b2, vals1 <> vals2)  -- | @EXISTS@ operator.  For example: --
test/Common/Test.hs view
@@ -1431,6 +1431,19 @@                return p         asserting $ ret `shouldBe` [ Entity p2k p2 ] +    itDb "NOT IN works for valList (null list)" $ do+        p1k <- insert p1+        p2k <- insert p2+        p3k <- insert p3+        ret <- select $+               from $ \p -> do+               where_ (p ^. PersonName `notIn` valList [])+               return p+        asserting $ ret `shouldMatchList` [ Entity p1k p1+                                          , Entity p2k p2+                                          , Entity p3k p3+                                          ]+     itDb "EXISTS works for subList_select" $ do         p1k <- insert p1         _p2k <- insert p2