Closed msullivan closed 1 year ago
In EdgeQL, common paths are "factored" to the closest surrounding subquery.
This is what allows
select User.first_name ++ ' ' ++ User.last_name
to return one row per user, as well as causing
select (User.name, count(User))
to always report 1 as the count, as well as letting
1
select (User.name, count(User.friends))
return each user's number of friends.
I don't believe that this is currently documented anywhere but https://www.edgedb.com/docs/reference/edgeql/eval, which does not explain it at all, it just shows how to define it.
The PR #4959 (mentioned above) adds a section on path resolution to the docs.
In EdgeQL, common paths are "factored" to the closest surrounding subquery.
This is what allows
to return one row per user, as well as causing
to always report
1
as the count, as well as lettingreturn each user's number of friends.
I don't believe that this is currently documented anywhere but https://www.edgedb.com/docs/reference/edgeql/eval, which does not explain it at all, it just shows how to define it.