in reply to DBIx::Class Pagination troubles

I used to do this manually, using the LIMIT/OFFSET SQL commands, where each page passed through the full SQL query, the page size & offset to the cgi script which would put them together, run the resulting query then put the original query, page size & new offset onto a 'next page' link.

Its fairly simple but the logic could get interesting at times. I had 1 script which would either display a results page or an 'enter query' page depending on how it was called.


just another cpan module author

Replies are listed 'Best First'.
Re^2: DBIx::Class Pagination troubles
by stonecolddevin (Parson) on Sep 27, 2006 at 15:40 UTC

    that sort of defeats the purpose of DBIx::Class, especially since there's a working method provided. I could understand maybe if there was no method provided, but the point is to abstract the SQL away from the logic :-)

    meh.
Re^2: DBIx::Class Pagination troubles
by dreel (Sexton) on Sep 19, 2007 at 06:24 UTC
    Can you write a part of code making this manual paging. I'm looking to this sample to do my realization:
    $C->{stuff} = $schema->storage->dbh_do( sub { my ($storage, $dbh, @cols) = @_; my $cols = join(q{, }, @cols); $dbh->selectrow_array("SELECT $cols FROM foo"); }, @column_list );
    But how to use it in TT? Is it return the same result as traditional $schema->search();