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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With