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?