@@ -424,6 +424,8 @@ QExpr a ++. QExpr b =
424
424
-- concatenating an element with an array).
425
425
-- - If the array is NULL, the result is NULL. If the element is NULL,
426
426
-- a NULL element is appended.
427
+ --
428
+ -- @since 0.5.4.4
427
429
arrayAppend_
428
430
:: QGenExpr ctxt Postgres s (V. Vector a )
429
431
-> QGenExpr ctxt Postgres s a
@@ -444,6 +446,8 @@ arrayAppend_ (QExpr arr) (QExpr el) =
444
446
-- - The array must be empty or one-dimensional.
445
447
-- - If the array is NULL, the result is NULL. If the element is NULL,
446
448
-- a NULL element is prepended.
449
+ --
450
+ -- @since 0.5.4.4
447
451
arrayPrepend_
448
452
:: QGenExpr ctxt Postgres s a
449
453
-> QGenExpr ctxt Postgres s (V. Vector a )
@@ -464,6 +468,8 @@ arrayPrepend_ (QExpr el) (QExpr arr) =
464
468
-- - The array must be one-dimensional.
465
469
-- - Returns NULL only if the array is NULL; if the value is not present,
466
470
-- the original array is returned unchanged.
471
+ --
472
+ -- @since 0.5.4.4
467
473
arrayRemove_
468
474
:: QGenExpr ctxt Postgres s (V. Vector a )
469
475
-> QGenExpr ctxt Postgres s a
@@ -489,6 +495,8 @@ arrayRemove_ (QExpr arr) (QExpr el) =
489
495
-- select_ $ pure $ arrayReplace_ (val_ $ V.fromList [1::Int32,2,5,4]) (val_ 5) (val_ 3)
490
496
-- -- => {1,2,3,4}
491
497
-- @
498
+ --
499
+ -- @since 0.5.4.4
492
500
arrayReplace_
493
501
:: QGenExpr ctxt Postgres s (V. Vector a ) -- ^ The array to operate on
494
502
-> QGenExpr ctxt Postgres s a -- ^ The value to be replaced
@@ -505,6 +513,8 @@ arrayReplace_ (QExpr arr) (QExpr fromVal) (QExpr toVal) =
505
513
506
514
-- | Postgres array_shuffle(array) function.
507
515
-- Randomly shuffles the first dimension.
516
+ --
517
+ -- @since 0.5.4.4
508
518
arrayShuffle_
509
519
:: QGenExpr ctxt Postgres s (V. Vector a )
510
520
-> QGenExpr ctxt Postgres s (V. Vector a )
@@ -517,10 +527,12 @@ arrayShuffle_ (QExpr arr) =
517
527
--
518
528
-- Precondition: @n@ must not exceed the length of the first dimension.
519
529
-- If n is negative, it will be treated as 0.
530
+ --
531
+ -- @since 0.5.4.4
520
532
arraySample_
521
533
:: Integral n
522
534
=> 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)
524
536
-> QGenExpr ctxt Postgres s (V. Vector a )
525
537
arraySample_ (QExpr arr) (QExpr n) =
526
538
QExpr (PgExpressionSyntax . mappend (emit " array_sample" ) . pgParens . mconcat <$> sequenceA
@@ -532,6 +544,8 @@ arraySample_ (QExpr arr) (QExpr n) =
532
544
533
545
-- | Postgres array_to_string(array, delimiter) function.
534
546
-- Converts each element to text and joins with the delimiter. NULLs are omitted.
547
+ --
548
+ -- @since 0.5.4.4
535
549
arrayToString_
536
550
:: QGenExpr ctxt Postgres s (V. Vector a )
537
551
-> QGenExpr ctxt Postgres s Text
@@ -545,6 +559,8 @@ arrayToString_ (QExpr arr) (QExpr delim) =
545
559
-- | Postgres array_to_string(array, delimiter, null_string) function.
546
560
-- Converts each element to text and joins with the delimiter. NULLs are
547
561
-- represented by the provided @null_string@.
562
+ --
563
+ -- @since 0.5.4.4
548
564
arrayToStringWithNull_
549
565
:: QGenExpr ctxt Postgres s (V. Vector a )
550
566
-> QGenExpr ctxt Postgres s Text
0 commit comments