Closed Giftzwerg02 closed 1 year ago
It looks like this is possible, maybe it could look something like this?
let fetched = client
.a()
.with(b::fetch())
.order_by(a::b::order(b::c::order(Direction::Asc)));
https://www.prisma.io/docs/concepts/components/prisma-client/filtering-and-sorting#sort-by-relation
What would be the input type of the order
function then? Since it currently takes a Direction
but returns an OrderByParam
(which is different per table).
Since it currently takes a
Direction
but returns anOrderByParam
That's only true for scalar fields, but we're talking about relation fields here. The relation field order
functions would take some sort of enum specific to that relation.
here we go!
I am having trouble ordering a selection by values from joined tables, it looks something like the following:
Digging through the generated code it seems to me that I can only provide columns directly from
a
and not from the joined values (also not by doinga::b::/*some_value*/
. I also haven't found any examples or hints in the documentation. Is there any way to get around this issue?