Skip to main content

json_agg

Function json_agg 

Source
pub fn json_agg<'a, V, E>(
    expr: E,
) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Json, Null, Agg, E::Sources>
Expand description

Collects values into a JSON array (JSON_AGG), on PostgreSQL.

Accepts any expression. The result is json, nullable, and an aggregate.

ยงExamples

assert_eq!(json_agg(users.name).sql(), r#"JSON_AGG ("users"."name")"#);