pub fn to_jsonb(ecx: &ExprContext<'_>, expr: HirScalarExpr) -> HirScalarExpr
Expand description
Converts an expression to ScalarType::Jsonb
.
The rules are as follows:
ScalarType::Boolean
s become JSON booleans.- All numeric types are converted to
Float64
s, then become JSON numbers. - Records are converted to a JSON object where the record’s field names
are the keys of the object, and the record’s fields are recursively
converted to JSON by
to_jsonb
. - Other types are converted to strings by their usual cast function an