felixmosh / knex-paginate

An extension of Knex's query builder with `paginate` method that will help with your pagination tasks.
MIT License
112 stars 12 forks source link

Request: Pass params to attachPaginate for global usage #24

Open owen-soak opened 2 years ago

owen-soak commented 2 years ago

I'd love to be able to pass isLengthAware: true to attachPaginate() as a param and have this take effect globally on all usages of paginate.

felixmosh commented 2 years ago

I think that it is possible, but not sure why would you like to do that.

Pay attention that isLengthAware makes an additional db query.

mrljsh commented 5 months ago

This would be a nice feature. I am aware that it would make an additional query but I need to know the total length for every request.

felixmosh commented 5 months ago

Would you like to make a PR for this?