This function:
defp entries(query, page_number, page_size) do offset = page_size * (page_number - 1) query |> limit([_], ^page_size) # error |> offset([_], ^offset) |> Repo.all end
gives an exception:
cannot use ^pg_size outside of match clauses
Why is that and how to fix it?
This is most usually a sign that you haven't imported appropriate macros from Ecto.Query.
Ecto.Query
2.1m questions
2.1m answers
60 comments
57.0k users