Skip to content

Commit 4a692db

Browse files
committed
Prepare for beam-core 0.10.4.0 release
1 parent 704d864 commit 4a692db

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

beam-core/ChangeLog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
# Unreleased
1+
# 0.10.4.0
22

33
## Added features
44

55
* Added a `Generic` instance to `SqlNull`, `SqlBitString`, and `SqlSerial` (#736).
66
* Added a note to `default_` to specify that it has more restrictions than its type may indicate (#744).
7+
* Added `limitMaybe_` and `offsetMaybe_` (#633).
78

89
## Updated dependencies
910

beam-core/Database/Beam/Query/Combinators.hs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{-# LANGUAGE CPP #-}
22
{-# LANGUAGE UndecidableInstances #-}
3-
{-# LANGUAGE CPP #-}
43

54
module Database.Beam.Query.Combinators
65
( -- * Various SQL functions and constructs
@@ -330,6 +329,8 @@ nub_ :: ( BeamSqlBackend be, Projectible be r )
330329
nub_ (Q sub) = Q $ liftF (QDistinct (\_ _ -> setQuantifierDistinct) sub id)
331330

332331
-- | Limit the number of results returned by a query.
332+
--
333+
-- See also `limitMaybe_` to conditionally apply a limit.
333334
limit_ :: forall s a be db
334335
. ( Projectible be a
335336
, ThreadRewritable (QNested s) a )
@@ -338,6 +339,8 @@ limit_ limit' (Q q) =
338339
Q (liftF (QLimit limit' q (rewriteThread (Proxy @s))))
339340

340341
-- | Conditionally limit the number of results returned by a query.
342+
--
343+
-- @since 0.10.4.0
341344
limitMaybe_ :: forall s a be db
342345
. ( Projectible be a
343346
, ThreadRewritable (QNested s) a )
@@ -348,15 +351,19 @@ limitMaybe_ (Just limit') (Q q) =
348351
-- See discussion on https://github.com/haskell-beam/beam/pull/633.
349352
limitMaybe_ Nothing (Q q) = Q (unsafeCoerce q)
350353

351-
-- | Drop the first `offset'` results.
354+
-- | Drop the first `offset` results.
355+
--
356+
-- See also `offsetMaybe_` to conditionally apply an offset
352357
offset_ :: forall s a be db
353358
. ( Projectible be a
354359
, ThreadRewritable (QNested s) a )
355360
=> Integer -> Q be db (QNested s) a -> Q be db s (WithRewrittenThread (QNested s) s a)
356361
offset_ offset' (Q q) =
357362
Q (liftF (QOffset offset' q (rewriteThread (Proxy @s))))
358363

359-
-- | Conditionally drop the first `offset'` results.
364+
-- | Conditionally drop the first `offset` results.
365+
--
366+
-- @since 0.10.4.0
360367
offsetMaybe_ :: forall s a be db
361368
. ( Projectible be a
362369
, ThreadRewritable (QNested s) a )

beam-core/beam-core.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
-- see http://haskell.org/cabal/users-guide/
33

44
name: beam-core
5-
version: 0.10.3.1
5+
version: 0.10.4.0
66
synopsis: Type-safe, feature-complete SQL query and manipulation interface for Haskell
77
description: Beam is a Haskell library for type-safe querying and manipulation of SQL databases.
88
Beam is modular and supports various backends. In order to use beam, you will need to use

0 commit comments

Comments
 (0)