The following function works fine, but I would like it to sort the results first by parent_id, and then by order.
def getTree = for {
(a, c) <- Activities leftJoin Clients on (_.id === _.id_a)
} yield (a.id, a.label, a.parent_id, a.order, c.id.?, a=c.name)
How do I do that using Slick?
Like with ordinary collection ?
getTree.sortBy(r => r._3 ~ r._4)
With Slick 2.1, I found this to work:
myQuery.sortBy(r => (r._3, r._4))
(verified by calling selectStatement
on my query)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With