@@ -27,14 +27,16 @@ extension QueryExpression where QueryValue: Codable & QueryBindable & Sendable {
2727 /// ```
2828 ///
2929 /// - Parameters:
30+ /// - isDistinct: An boolean to enable the `DISTINCT` clause to apply to the aggregation.
3031 /// - order: An `ORDER BY` clause to apply to the aggregation.
3132 /// - filter: A `FILTER` clause to apply to the aggregation.
3233 /// - Returns: A JSON array aggregate of this expression.
3334 public func jsonGroupArray(
35+ isDistinct: Bool = false ,
3436 order: ( some QueryExpression ) ? = Bool ? . none,
3537 filter: ( some QueryExpression < Bool > ) ? = Bool ? . none
3638 ) -> some QueryExpression < [ QueryValue ] . JSONRepresentation> {
37- AggregateFunction ( " json_group_array " , self , order: order, filter: filter)
39+ AggregateFunction ( " json_group_array " , isDistinct : isDistinct , self , order: order, filter: filter)
3840 }
3941}
4042
@@ -85,14 +87,16 @@ extension PrimaryKeyedTableDefinition where QueryValue: Codable & Sendable {
8587 /// }
8688 ///
8789 /// - Parameters:
90+ /// - isDistinct: An boolean to enable the `DISTINCT` clause to apply to the aggregation.
8891 /// - order: An `ORDER BY` clause to apply to the aggregation.
8992 /// - filter: A `FILTER` clause to apply to the aggregation.
9093 /// - Returns: A JSON array aggregate of this table.
9194 public func jsonGroupArray(
95+ isDistinct: Bool = false ,
9296 order: ( some QueryExpression ) ? = Bool ? . none,
9397 filter: ( some QueryExpression < Bool > ) ? = Bool ? . none
9498 ) -> some QueryExpression < [ QueryValue ] . JSONRepresentation> {
95- AggregateFunction ( " json_group_array " , jsonObject, order: order, filter: filter)
99+ AggregateFunction ( " json_group_array " , isDistinct : isDistinct , jsonObject, order: order, filter: filter)
96100 }
97101
98102 private var jsonObject : some QueryExpression < QueryValue > {
0 commit comments