on master help sign in
Bump Opaleye dependency to 0.7.2.0 to take advantage of new EXISTS support
commit93da8410ace438b9190736983e31f459cd42bc40 authorShane O'Brien <shane.obrien@circuithub.com> dateTue 22 Jun 2021, 12:46 (5 years ago) parent4cb7797
3 files changed+8−10
nix/sources.json+3−3 rel8.cabal+1−1 src/Rel8/Query/Exists.hs+4−6
nix/sources.json+3−3
@@ -5,10 +5,10 @@
55 "homepage": "https://input-output-hk.github.io/haskell.nix",
66 "owner": "input-output-hk",
77 "repo": "haskell.nix",
8− "rev": "5b5a18e442df6e27ad8549d69b8868b62adb08c3",
9− "sha256": "055mk7kmjppng66ppnb8kr96v4wwc8pcxfsls5gl77129hsz9aph",
8+ "rev": "e7bb8ab2921a11a1d014c70a87898f73e086594d",
9+ "sha256": "17c0xqzwnchcy71p8372cydcxc7qf0i8x12d0lf6p1g8yd4al6fa",
1010 "type": "tarball",
11− "url": "https://github.com/input-output-hk/haskell.nix/archive/5b5a18e442df6e27ad8549d69b8868b62adb08c3.tar.gz",
11+ "url": "https://github.com/input-output-hk/haskell.nix/archive/e7bb8ab2921a11a1d014c70a87898f73e086594d.tar.gz",
1212 "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
1313 },
1414 "niv": {
rel8.cabal+1−1
@@ -25,7 +25,7 @@ library
2525 , case-insensitive
2626 , contravariant
2727 , hasql ^>= 1.4.5.1
28− , opaleye ^>= 0.7.1.0
28+ , opaleye ^>= 0.7.2.0
2929 , profunctors
3030 , scientific
3131 , semialign
src/Rel8/Query/Exists.hs+4−6
@@ -11,23 +11,21 @@ where
1111import Prelude hiding ( filter )
1212
1313-- opaleye
14−import qualified Opaleye.Operators as Opaleye
14+import qualified Opaleye.Exists as Opaleye
15+import qualified Opaleye.Operators as Opaleye hiding ( exists )
1516
1617-- rel8
1718import Rel8.Expr ( Expr )
19+import Rel8.Expr.Opaleye ( fromColumn, fromPrimExpr )
1820import Rel8.Query ( Query )
1921import Rel8.Query.Filter ( filter )
20−import Rel8.Query.Maybe ( optional )
2122import Rel8.Query.Opaleye ( mapOpaleye )
2223import Rel8.Table.Eq ( EqTable, (==:) )
23−import Rel8.Table.Maybe ( isJustTable )
2424
2525
2626-- | Checks if a query returns at least one row.
2727exists :: Query a -> Query (Expr Bool)
28−exists = fmap isJustTable . optional . present
29−-- FIXME: change this when b7aacc07c6392654cae439fc3b997620c3aa7a87 makes it
30−-- into a release of Opaleye
28+exists = fmap (fromPrimExpr . fromColumn) . mapOpaleye Opaleye.exists
3129
3230
3331inQuery :: EqTable a => a -> Query a -> Query (Expr Bool)