Relation query `extras` needs access to `with`
I have a mysql table with two relations to another table. (one is for source values, one is for optional admin edited values.)
The app logic is "if admin value exists, return admin value, else return source value". (But do not return both, since it would be a large network payload)
The relation query easily includes the 2 related columns via
with
key.
But, the extras
key cannot access the related columns.
Is there another way to achieve this "computed" extras column type?
(Maybe this is a good use for "Views" feature)
e.g.:
1 Reply
Maybe this is what the docs are mentioning:
As of now aggregations are not supported in extras, please use core queries for thathttps://orm.drizzle.team/docs/rqb#include-custom-fields which is no problem, because I am discovering the
sql
operator really is magic! 👍