-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Having wrong before and after key values whenever I'm using select in query #148
Comments
I also tried with %Paginator.Page.Metadata{
after: "g3QAAAABZAALaW5zZXJ0ZWRfYXR0AAAACWQACl9fc3RydWN0X19kABRFbGl4aXIuTmFpdmVEYXRlVGltZWQACGNhbGVuZGFyZAATRWxpeGlyLkNhbGVuZGFyLklTT2QAA2RheWEeZAAEaG91cmEOZAALbWljcm9zZWNvbmRoAmEAYQBkAAZtaW51dGVhBGQABW1vbnRoYQtkAAZzZWNvbmRhMGQABHllYXJiAAAH5Q==",
before: "g3QAAAABZAALaW5zZXJ0ZWRfYXR0AAAACWQACl9fc3RydWN0X19kABRFbGl4aXIuTmFpdmVEYXRlVGltZWQACGNhbGVuZGFyZAATRWxpeGlyLkNhbGVuZGFyLklTT2QAA2RheWEeZAAEaG91cmEOZAALbWljcm9zZWNvbmRoAmEAYQBkAAZtaW51dGVhBGQABW1vbnRoYQtkAAZzZWNvbmRhMGQABHllYXJiAAAH5Q==",
limit: 2,
total_count: 20,
total_count_cap_exceeded: false
} |
Thanks for raising this issue! Are you able to provide a small dataset to help us verify this bug? |
@sgerrand thank you for your response. I was using the paginator database to confirm the issue query = from(c in Payment, order_by: [asc: c.inserted_at, asc: c.id], select: %{c: c})
%{metadata: %{after: cursor}} = Repo.paginate(query, cursor_fields: [inserted_at: :asc, id: :asc], limit: 3)
%{metadata: %{before: ^cursor, after: ^cursor}} =
Repo.paginate(query, cursor_fields: [inserted_at: :asc, id: :asc], after: cursor, limit: 3) |
Hello! I can confirm this bugs happens in my program when I'm using a If I can help debug this issue, tell me. |
I have found the solution. You just need to be sure that in the It worked for me 🙌🏻 . |
We've faced in a problem while we are using Paginator with
Ecto.Query.select/3
There is a code sample:
Got a metadata:
And after I applied it to fetch a next page I got it but before and after keys have the same values as a previous Metadata has.
Any workaround here?
The text was updated successfully, but these errors were encountered: