aarondfrancis / fast-paginate

A fast implementation of offset/limit pagination for Laravel.
MIT License
1.21k stars 56 forks source link

[Question] Sort order is changed when using `fastPaginate` compared to `paginate` #32

Closed Naoray closed 2 years ago

Naoray commented 2 years ago

I wasn't able to pinpoint where it happens and why, but using paginate() I get the results ordered by created_at desc, while using fastPaginate() does return the results as if ordered by created_at asc.

In my example the primary keys are uuids -> could this be the issue?

aarondfrancis commented 2 years ago

@Naoray can you give me a little more info? I have a test that ensures the order is propagated from the outer query to the inner query, but there might be a case that I missed.

Can you boil it down to a reproducible case? Thanks!

Naoray commented 2 years ago

@aarondfrancis s. test I added in #34.

aarondfrancis commented 2 years ago

To anyone reading this in the future: see #34 for explanations. Closing.