You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to be able to construct a postgres array using the Array constructor:
SELECT ARRAY[3, 4, 5 + 6];
Notice that the elements are expressions rather than simply values.
Proposed Solutions
Allow functions to use either square brackets ([ and ]) or ordinary parentheses (( and )) as their invocation method. The default should be parentheses, with only a few operators or functions requiring square brackets.
Additional Information
Unfortunately, the while the current Value type supports arrays, it does not support embedding expressions in the array constructor.
This wouldn't be such a big limitation if we could work around this using custom expressions, but even this isn't possible:
let array_expr = sea_query::Expr::cust_with_exprs("ARRAY [ $, $, $, $ ]",["a".into(),"b".into(),"c".into(),"d".into()]);
doesn't produce the expected outcome when building because the square brackets are apparently interpreted as string delimiters when tokenizing.
The text was updated successfully, but these errors were encountered:
Motivation
I want to be able to construct a postgres array using the
Array
constructor:Notice that the elements are expressions rather than simply values.
Proposed Solutions
Allow functions to use either square brackets (
[
and]
) or ordinary parentheses ((
and)
) as their invocation method. The default should be parentheses, with only a few operators or functions requiring square brackets.Additional Information
Unfortunately, the while the current
Value
type supports arrays, it does not support embedding expressions in the array constructor.This wouldn't be such a big limitation if we could work around this using custom expressions, but even this isn't possible:
doesn't produce the expected outcome when building because the square brackets are apparently interpreted as string delimiters when tokenizing.
The text was updated successfully, but these errors were encountered: