As per the docs you can pass in a list of things to order by:
query |> order_by([c], asc: c.name, desc: c.population)
It can even be dynamic:
values = [asc: :name, desc_nulls_first: :population]
query |> order_by([c], ^values)
As per the docs you can pass in a list of things to order by:
query |> order_by([c], asc: c.name, desc: c.population)
It can even be dynamic:
values = [asc: :name, desc_nulls_first: :population]
query |> order_by([c], ^values)