Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Case when DB table is empty #1

Open
gmile opened this issue Nov 17, 2016 · 0 comments
Open

Case when DB table is empty #1

gmile opened this issue Nov 17, 2016 · 0 comments

Comments

@gmile
Copy link
Contributor

gmile commented Nov 17, 2016

In case when there are no records in target table, an error is raised:

iex(3)> {res, next_paging} = Gateway.DB.Configs.Repo.page(query, %Ecto.Paging{limit: 150})

11:47:33.218 [debug] QUERY OK source="apis" db=1.6ms
SELECT a0."id", a0."name", a0."request", a0."inserted_at", a0."updated_at" FROM "apis" AS a0 LIMIT $1 [150]
** (UndefinedFunctionError) function nil.id/0 is undefined or private
              nil.id()
              Ecto.Paging.get_next_cursors/2
              lib/ecto/paging.ex:119: Ecto.Paging.get_next_paging/2
    (gateway) lib/ecto/repo.ex:42: Gateway.DB.Configs.Repo.page/3

It looks like it is related to https://github.com/Nebo15/ecto_paging/blob/master/lib/ecto/paging.ex#L129.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant