madelfio/datarator — Issue #1: Support Report Pagination
Author: madelfio
Created: 2011-12-16 02:07:15+00:00
State: open

Generate links below report allowing user to select a page of report rows to view.

Functionailty is made more complex by the fact that there's no perfect way to count the total pages available across all DB's/sources.

Option 1 (use analytic/window function):

select , count(*) over () from (ROOTQUERY)

Option 2 (use second query):

select from (ROOTQUERY)
select count(*) from (ROOTQUERY)

Option 3 (no pages estimate, just show `Next' and `Previous' links):

select from (ROOTQUERY) offset PAGENUM*PAGESIZE limit PAGESIZE + 1