go-paginate
go-paginate copied to clipboard
chore!: Not getting all records when order by other columns apart from primary key
I have two columns in my database . these are number{primary key} and name .
when i sort by number , the pagination works fine and i am getting all the records . But when i sort by name , i am getting data only as per the limit in the request , apart from that all records having same name is not showing in the next page . It skipped those records and go to the records with other name .
Arg, yeah I ran into this too, but the cause for me is trying to paginate through a distinct column.
My original query is like DISTINCT (fieldA) and so returns something like
fieldA, fieldB
a, 1
b, 2
but this plugin has no way to return distinct, so the pagination query is returned as something like
fieldA, fieldB
a, 1
a,2
a,3
b, 2
b,2
b,7
So pagintion with page size = 1 seems to work, but if you set page size to 2, you are paging through results that don't exist in the original query...