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
1.4m articles
1.4m replys
5 comments
57.0k users