GROUP BY requires mapping because we cannot do SELECT * FROM t GROUP BY ... -> introduce method groupMap(g: Scope => Tuple | Expression[?])(f: Scope => Tuple | Scope).
The Scope in the second parameter list must be a special scope in which only the expressions return by g are directly available. Other expressions from the original scope should be somehow boxed such that they are not instances of Expression[?] but they have aggregation methods on them.
Question: how to let the user easily introduce new aggregation functions just by listing them at one place? Aggregations should always appear on
GROUP BY requires mapping because we cannot do
SELECT * FROM t GROUP BY ...
-> introduce methodgroupMap(g: Scope => Tuple | Expression[?])(f: Scope => Tuple | Scope)
. The Scope in the second parameter list must be a special scope in which only the expressions return byg
are directly available. Other expressions from the original scope should be somehow boxed such that they are not instances ofExpression[?]
but they have aggregation methods on them.Question: how to let the user easily introduce new aggregation functions just by listing them at one place? Aggregations should always appear on
QueryBuilder[Expression[T]]