diff --git a/src/Database/Esqueleto.hs b/src/Database/Esqueleto.hs index 9a546f0..f33c882 100644 --- a/src/Database/Esqueleto.hs +++ b/src/Database/Esqueleto.hs @@ -44,7 +44,7 @@ module Database.Esqueleto , val, isNothing, just, nothing, joinV, withNonNull , countRows, count, countDistinct , not_, (==.), (>=.), (>.), (<=.), (<.), (!=.), (&&.), (||.) - , between, (+.), (-.), (/.), (*.) + , (+.), (-.), (/.), (*.) , random_, round_, ceiling_, floor_ , min_, max_, sum_, avg_, castNum, castNumM , coalesce, coalesceDefault diff --git a/src/Database/Esqueleto/Internal/Language.hs b/src/Database/Esqueleto/Internal/Language.hs index a1efb70..ac992e1 100644 --- a/src/Database/Esqueleto/Internal/Language.hs +++ b/src/Database/Esqueleto/Internal/Language.hs @@ -352,11 +352,6 @@ class (Functor query, Applicative query, Monad query) => (/.) :: PersistField a => expr (Value a) -> expr (Value a) -> expr (Value a) (*.) :: PersistField a => expr (Value a) -> expr (Value a) -> expr (Value a) - -- | @BETWEEN@ operator - -- - -- /Since: 2.8.0/ - between :: PersistField typ => expr (Value typ) -> (expr (Value typ), expr (Value typ)) -> expr (Value Bool) - random_ :: (PersistField a, Num a) => expr (Value a) round_ :: (PersistField a, Num a, PersistField b, Num b) => expr (Value a) -> expr (Value b) diff --git a/src/Database/Esqueleto/Internal/Sql.hs b/src/Database/Esqueleto/Internal/Sql.hs index 43ad016..7f2e0c9 100644 --- a/src/Database/Esqueleto/Internal/Sql.hs +++ b/src/Database/Esqueleto/Internal/Sql.hs @@ -97,7 +97,6 @@ instance Exception EsqueletoError data CompositeKeyError = NotError - | BetweenError | ToInsertionError | CombineInsertionError | FoldHelpError @@ -534,12 +533,6 @@ instance Esqueleto SqlQuery SqlExpr SqlBackend where (/.) = unsafeSqlBinOp " / " (*.) = unsafeSqlBinOp " * " - a `between` (ERaw _ f, ERaw _ g) = unsafeSqlBinOp " BETWEEN " a $ ERaw Never $ \x -> - let (_, fv) = f x - (_, gv) = g x - in (" ? AND ? ", fv ++ gv) - _ `between` _ = throw $ CompositeKeyErr BetweenError - random_ = unsafeSqlValue "RANDOM()" round_ = unsafeSqlFunction "ROUND" ceiling_ = unsafeSqlFunction "CEILING" diff --git a/test/Common/Test.hs b/test/Common/Test.hs index 1ecb17b..d5cac2c 100644 --- a/test/Common/Test.hs +++ b/test/Common/Test.hs @@ -629,16 +629,6 @@ testSelectWhere run = do return p liftIO $ ret `shouldBe` [ p3e ] - it "works for a simple example with between and [uses just . val]" $ - run $ do - p1e <- insert' p1 - _ <- insert' p2 - _ <- insert' p3 - ret <- select $ - from $ \p -> do - where_ ((p ^. PersonAge) `between` (just $ val 20, just $ val 40)) - return p - liftIO $ ret `shouldBe` [ p1e ] it "works with avg_" $ run $ do _ <- insert' p1