[Dbix-class] resultset paging

Matt S Trout dbix-class at trout.me.uk
Sat Aug 11 03:14:50 GMT 2007


On Fri, Aug 10, 2007 at 01:25:26PM -0500, Timotheus Keefer wrote:
> 
> Is this method of paging no longer valid? It has worked in previous  
> versions of DBIC.
> 
>     my $results = $schema->resultset('mytable')->search(
>         $search,
>         {
>             rows     => 5,
>             page     => $page,
>         }
>     );
> 
>     my $rows          = $results->page();
> 
>     while ( my $row = $rows->next ) {
> 		
>     }
> 
> 
> It appears the page number is now required, or at least it works  
> correctly, when calling page() on the result set with the page number.

That's never been documented to work, you've been relying on an unreported
bug.

$results is already the page if you supply it as an attr, just use ->all

Better still, don't supply it as an attr and use ->page($page)

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director    Want a managed development or deployment platform?
 Shadowcat Systems Ltd.  Contact mst (at) shadowcatsystems.co.uk for a quote
http://chainsawblues.vox.com/                    http://www.shadowcat.co.uk/ 



More information about the DBIx-Class mailing list