Working around Postgres forcing DISTINCT fields to also be ORDER BY fields

from blog Zarar's blog, | ↗ original
I've been using Flop for pagination in my Elixir app and learned that anytime a DISTINCT clause is used in Ecto when using Postgres, the columns in the clause are prepended to any ORDER BY clauses in the query. This was causing a lot of problems for Flop since it uses specific columns for cursor-based pagination and doing a DISTINCT product.id...