Skip to content

Commit eafea7b

Browse files
committed
Prepare beam-postgres 0.5.4.4 release
1 parent 8833d00 commit eafea7b

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

beam-postgres/ChangeLog.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# Unreleased
1+
# 0.5.4.4
2+
3+
## Added features
4+
5+
* Added the array functions `arrayAppend_`, `arrayPrepend_`, `arrayRemove_`, `arrayReplace_`, `arrayShuffle_`, `arraySample_`, `arrayToString_`, and `arrayToStringWithNull_` (#770)
26

37
## Updated dependencies
48

beam-postgres/Database/Beam/Postgres/PgSpecific.hs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,8 @@ QExpr a ++. QExpr b =
424424
-- concatenating an element with an array).
425425
-- - If the array is NULL, the result is NULL. If the element is NULL,
426426
-- a NULL element is appended.
427+
--
428+
-- @since 0.5.4.4
427429
arrayAppend_
428430
:: QGenExpr ctxt Postgres s (V.Vector a)
429431
-> QGenExpr ctxt Postgres s a
@@ -444,6 +446,8 @@ arrayAppend_ (QExpr arr) (QExpr el) =
444446
-- - The array must be empty or one-dimensional.
445447
-- - If the array is NULL, the result is NULL. If the element is NULL,
446448
-- a NULL element is prepended.
449+
--
450+
-- @since 0.5.4.4
447451
arrayPrepend_
448452
:: QGenExpr ctxt Postgres s a
449453
-> QGenExpr ctxt Postgres s (V.Vector a)
@@ -464,6 +468,8 @@ arrayPrepend_ (QExpr el) (QExpr arr) =
464468
-- - The array must be one-dimensional.
465469
-- - Returns NULL only if the array is NULL; if the value is not present,
466470
-- the original array is returned unchanged.
471+
--
472+
-- @since 0.5.4.4
467473
arrayRemove_
468474
:: QGenExpr ctxt Postgres s (V.Vector a)
469475
-> QGenExpr ctxt Postgres s a
@@ -489,6 +495,8 @@ arrayRemove_ (QExpr arr) (QExpr el) =
489495
-- select_ $ pure $ arrayReplace_ (val_ $ V.fromList [1::Int32,2,5,4]) (val_ 5) (val_ 3)
490496
-- -- => {1,2,3,4}
491497
-- @
498+
--
499+
-- @since 0.5.4.4
492500
arrayReplace_
493501
:: QGenExpr ctxt Postgres s (V.Vector a) -- ^ The array to operate on
494502
-> QGenExpr ctxt Postgres s a -- ^ The value to be replaced
@@ -505,6 +513,8 @@ arrayReplace_ (QExpr arr) (QExpr fromVal) (QExpr toVal) =
505513

506514
-- | Postgres array_shuffle(array) function.
507515
-- Randomly shuffles the first dimension.
516+
--
517+
-- @since 0.5.4.4
508518
arrayShuffle_
509519
:: QGenExpr ctxt Postgres s (V.Vector a)
510520
-> QGenExpr ctxt Postgres s (V.Vector a)
@@ -517,10 +527,12 @@ arrayShuffle_ (QExpr arr) =
517527
--
518528
-- Precondition: @n@ must not exceed the length of the first dimension.
519529
-- If n is negative, it will be treated as 0.
530+
--
531+
-- @since 0.5.4.4
520532
arraySample_
521533
:: Integral n
522534
=> QGenExpr ctxt Postgres s (V.Vector a) -- ^ The source array
523-
-> QGenExpr ctxt Postgres s n -- ^ Number of elements to sample (negative values treated as 0)
535+
-> QGenExpr ctxt Postgres s n -- ^ Number of elements to sample (negative values treated as 0)
524536
-> QGenExpr ctxt Postgres s (V.Vector a)
525537
arraySample_ (QExpr arr) (QExpr n) =
526538
QExpr (PgExpressionSyntax . mappend (emit "array_sample") . pgParens . mconcat <$> sequenceA
@@ -532,6 +544,8 @@ arraySample_ (QExpr arr) (QExpr n) =
532544

533545
-- | Postgres array_to_string(array, delimiter) function.
534546
-- Converts each element to text and joins with the delimiter. NULLs are omitted.
547+
--
548+
-- @since 0.5.4.4
535549
arrayToString_
536550
:: QGenExpr ctxt Postgres s (V.Vector a)
537551
-> QGenExpr ctxt Postgres s Text
@@ -545,6 +559,8 @@ arrayToString_ (QExpr arr) (QExpr delim) =
545559
-- | Postgres array_to_string(array, delimiter, null_string) function.
546560
-- Converts each element to text and joins with the delimiter. NULLs are
547561
-- represented by the provided @null_string@.
562+
--
563+
-- @since 0.5.4.4
548564
arrayToStringWithNull_
549565
:: QGenExpr ctxt Postgres s (V.Vector a)
550566
-> QGenExpr ctxt Postgres s Text

beam-postgres/beam-postgres.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: beam-postgres
2-
version: 0.5.4.3
2+
version: 0.5.4.4
33
synopsis: Connection layer between beam and postgres
44
description: Beam driver for <https://www.postgresql.org/ PostgreSQL>, an advanced open-source RDBMS
55
homepage: https://haskell-beam.github.io/beam/user-guide/backends/beam-postgres

0 commit comments

Comments
 (0)