@@ -1427,7 +1427,7 @@ class Aggregate expr1 expr2 aggr
1428 -- >>> :{
1428 -- >>> :{
1430− -- expression :: Expression (Grouped bys) commons schemas params from ('NotNull 'PGint8)
1430+ -- expression :: Expression outer ('Grouped bys) commons schemas params from ('NotNull 'PGint8)
1431 -- expression = countStar
1431 -- expression = countStar
1432 -- in printSQL expression
1432 -- in printSQL expression
@@ -1436,7 +1436,7 @@ class Aggregate expr1 expr2 aggr
1437 -- | >>> :{
1437 -- | >>> :{
1439− -- expression :: Expression (Grouped bys) commons schemas params '[tab ::: '["col" ::: nullity ty]] ('NotNull 'PGint8)
1439+ -- expression :: Expression outer ('Grouped bys) commons schemas params '[tab ::: '["col" ::: nullity ty]] ('NotNull 'PGint8)
1440 -- expression = count (All #col)
1440 -- expression = count (All #col)
1441 -- in printSQL expression
1441 -- in printSQL expression
@@ -1463,6 +1463,16 @@ class Aggregate expr1 expr2 aggr
1463 :: expr1 ty
1463 :: expr1 ty
1464 -> aggr ('NotNull ('PGvararray ty))
1464 -> aggr ('NotNull ('PGvararray ty))
1466+ -- | aggregates values as a JSON array
1469+ -> aggr ('NotNull 'PGjson)
1471+ -- | aggregates values as a JSON array
1474+ -> aggr ('NotNull 'PGjsonb)
1466 -- | >>> :{
1476 -- | >>> :{
1468 -- expression :: Expression outer ('Grouped bys) commons schemas params '[tab ::: '["col" ::: nullity 'PGint4]] (nullity 'PGint4)
1478 -- expression :: Expression outer ('Grouped bys) commons schemas params '[tab ::: '["col" ::: nullity 'PGint4]] (nullity 'PGint4)
@@ -1503,7 +1513,7 @@ class Aggregate expr1 expr2 aggr
1504 -- | >>> :{
1514 -- | >>> :{
1506− -- expression :: Expression (Grouped bys) commons schemas params '[tab ::: '["col" ::: nullity 'PGbool]] (nullity 'PGbool)
1516+ -- expression :: Expression outer ('Grouped bys) commons schemas params '[tab ::: '["col" ::: nullity 'PGbool]] (nullity 'PGbool)
1507 -- expression = boolOr (All #col)
1517 -- expression = boolOr (All #col)
1508 -- in printSQL expression
1518 -- in printSQL expression
@@ -1548,7 +1558,7 @@ class Aggregate expr1 expr2 aggr
1548 {- | correlation coefficient
1558 {- | correlation coefficient
1551− expression :: Expression ('Grouped g) c s p '[t ::: '["x" ::: 'NotNull 'PGfloat8, "y" ::: 'NotNull 'PGfloat8]] ('NotNull 'PGfloat8)
1561+ expression :: Expression o ('Grouped g) c s p '[t ::: '["x" ::: 'NotNull 'PGfloat8, "y" ::: 'NotNull 'PGfloat8]] ('NotNull 'PGfloat8)
1552 expression = corr (All (#y :*: #x))
1562 expression = corr (All (#y :*: #x))
1553 in printSQL expression
1563 in printSQL expression
@@ -1561,7 +1571,7 @@ class Aggregate expr1 expr2 aggr
1561 {- | population covariance
1571 {- | population covariance
1564− expression :: Expression ('Grouped g) c s p '[t ::: '["x" ::: 'NotNull 'PGfloat8, "y" ::: 'NotNull 'PGfloat8]] ('NotNull 'PGfloat8)
1574+ expression :: Expression o ('Grouped g) c s p '[t ::: '["x" ::: 'NotNull 'PGfloat8, "y" ::: 'NotNull 'PGfloat8]] ('NotNull 'PGfloat8)
1565 expression = covarPop (All (#y :*: #x))
1575 expression = covarPop (All (#y :*: #x))
1566 in printSQL expression
1576 in printSQL expression
@@ -1587,7 +1597,7 @@ class Aggregate expr1 expr2 aggr
1587 {- | average of the independent variable (sum(X)/N)
1597 {- | average of the independent variable (sum(X)/N)
1590− expression :: Expression ('Grouped g) c s p '[t ::: '["x" ::: 'NotNull 'PGfloat8, "y" ::: 'NotNull 'PGfloat8]] ('NotNull 'PGfloat8)
1600+ expression :: Expression o ('Grouped g) c s p '[t ::: '["x" ::: 'NotNull 'PGfloat8, "y" ::: 'NotNull 'PGfloat8]] ('NotNull 'PGfloat8)
1591 expression = regrAvgX (All (#y :*: #x))
1601 expression = regrAvgX (All (#y :*: #x))
1592 in printSQL expression
1602 in printSQL expression
@@ -1626,7 +1636,7 @@ class Aggregate expr1 expr2 aggr
1626 {- | y-intercept of the least-squares-fit linear equation determined by the (X, Y) pairs
1636 {- | y-intercept of the least-squares-fit linear equation determined by the (X, Y) pairs
1629− expression :: Expression ('Grouped g) c s p '[t ::: '["x" ::: 'NotNull 'PGfloat8, "y" ::: 'NotNull 'PGfloat8]] ('NotNull 'PGfloat8)
1639+ expression :: Expression o ('Grouped g) c s p '[t ::: '["x" ::: 'NotNull 'PGfloat8, "y" ::: 'NotNull 'PGfloat8]] ('NotNull 'PGfloat8)
1630 expression = regrIntercept (All (#y :*: #x))
1640 expression = regrIntercept (All (#y :*: #x))
1631 in printSQL expression
1641 in printSQL expression
@@ -1725,6 +1735,8 @@ instance Aggregate
1725 count = unsafeAggregate1 "count"
1735 count = unsafeAggregate1 "count"
1726 sum_ = unsafeAggregate1 "sum"
1736 sum_ = unsafeAggregate1 "sum"
1727 arrayAgg = unsafeAggregate1 "array_agg"
1737 arrayAgg = unsafeAggregate1 "array_agg"
1738+ jsonAgg = unsafeAggregate1 "json_agg"
1739+ jsonbAgg = unsafeAggregate1 "jsonb_agg"
1728 bitAnd = unsafeAggregate1 "bit_and"
1740 bitAnd = unsafeAggregate1 "bit_and"
1729 bitOr = unsafeAggregate1 "bit_or"
1741 bitOr = unsafeAggregate1 "bit_or"
1730 boolAnd = unsafeAggregate1 "bool_and"
1742 boolAnd = unsafeAggregate1 "bool_and"
@@ -1759,6 +1771,8 @@ instance Aggregate
1759 count = unsafeWindowFunction1 "count"
1771 count = unsafeWindowFunction1 "count"
1760 sum_ = unsafeWindowFunction1 "sum"
1772 sum_ = unsafeWindowFunction1 "sum"
1761 arrayAgg = unsafeWindowFunction1 "array_agg"
1773 arrayAgg = unsafeWindowFunction1 "array_agg"
1774+ jsonAgg = unsafeWindowFunction1 "json_agg"
1775+ jsonbAgg = unsafeWindowFunction1 "jsonb_agg"
1762 bitAnd = unsafeWindowFunction1 "bit_and"
1776 bitAnd = unsafeWindowFunction1 "bit_and"
1763 bitOr = unsafeWindowFunction1 "bit_or"
1777 bitOr = unsafeWindowFunction1 "bit_or"
1764 boolAnd = unsafeWindowFunction1 "bool_and"
1778 boolAnd = unsafeWindowFunction1 "bool_and"