josefkjaergaard
josefkjaergaard
DTDrizzle Team
Created by josefkjaergaard on 6/20/2023 in #help
Ordering by relation in relational query
I am trying to sort on an attribute of a relation using the relational queries api, but as far as I can tell it is not supported? Example:
await db.query.city.findMany({
orderBy: (country , { asc }) => [asc(country.name)],
with: {
country: true,
},
});
await db.query.city.findMany({
orderBy: (country , { asc }) => [asc(country.name)],
with: {
country: true,
},
});
Thanks, J
3 replies