[Dbix-class] paging question

demerphq demerphq at gmail.com
Wed Feb 3 23:28:39 GMT 2010


On 4 February 2010 00:01, James Marca <jmarca at translab.its.uci.edu> wrote:
> On Wed, Feb 03, 2010 at 11:14:28PM +0100, demerphq wrote:
>> Ive implemented this type of thing outside of DBIx by limiting the
>> query to one more record than I intend to page.
>>
>> This works nicely as it does two things. First it gives me a flag
>> which i can use to decide whether a page need a "show next page link",
>> and it gives me an item that i can use to prekey the paging so it does
>> NOT use the offset/limit form, and instead uses the id of the flag
>> record to do an indexed search from where the next page starts.
>>
>
> Ah, very clever hack!

Its pretty easy to do with one way paging, a bit harder with
bi-directional paging. But still not too hard.

Yves

-- 
perl -Mre=debug -e "/just|another|perl|hacker/"



More information about the DBIx-Class mailing list