Uysim / pagy-cursor

Cursor pagination with pagy for Ruby On Rails
MIT License
126 stars 23 forks source link

Optimize Query without has more requery #32

Open Uysim opened 2 years ago

Uysim commented 2 years ago

@yunanhelmy had optimize this with PR #19. But from result issue #28 which lead us to revert back to ActiveRecord::Relation. Even so, I still think some developer need to optimize this query. I think we should have two extra modules pagy_cursor/pagy/extras/optimal_cursor and pagy_cursor/pagy/extras/optimal_uuid_cursor which behave the same as #19 and return Ruby Array. From that implementation developer able to pick the implementation that he want.

Uysim commented 2 years ago

@yunanhelmy can you help in this contribution?

yunanhelmy commented 2 years ago

@yunanhelmy can you help in this contribution?

@Uysim I'll help this one.

yunanhelmy commented 2 years ago

@Uysim what about adding vars[:lazy] using default = true. Developer can pass { lazy: false } if they want to return an array.