How to create a dynamic Ecto query?

subquery could maybe be something like:

Comment
|> order_by([:is_active, {:desc, :is_active_last_updated}])
|> limit(1)