pilagod / gorm-cursor-paginator

A paginator doing cursor-based pagination based on GORM
https://github.com/pilagod/gorm-cursor-paginator
MIT License
188 stars 44 forks source link

Pagination using `HAVING` clauses #68

Open tscolari opened 1 day ago

tscolari commented 1 day ago

Hello 👋

I'm wondering what are your thoughts - and if you would be open for a potential PR - on having an option to filter fields by Having instead of Where.

The main use case in my scenario is that I'm trying to paginate through a table that has an aggregated value (e.g. sum(total)) and trying to paginate on top of that.

Thanks!

pilagod commented 14 hours ago

Sure, we are welcome to pull request for any good idea. This is truly a scenario that this library not yet supported.

There might be challenges to integrate having aggregation patterns and also keep compatible with the original where model. To be honest I don't have much ideas on how to implement it at this moment. I would appreciate any attempt to bring this feature into reality 💪