I think it would it be useful to include a method in the db class to get the total number of rows before applying the offset and limit filter.. an example would be in passing total number of records to the pagination config variable without querying the database twice.
What do you guys think?