cannblw / knex-paginator

Simple paginator for Knex. It adds the .paginate() function to Knex's query builder.
15 stars 10 forks source link

LengthAware with query of page # >1 throws 'Cannot read property 'total' of undefined' #10

Open felixmosh opened 5 years ago

felixmosh commented 5 years ago

I'm using Mysql,

And if you query with offset & limit on a count(*) query, it will return an empty set.

Adding .offset(0) solves that issue.

Select Count(*) as total from tableName Limit 20,20 will return an empty set