NAME

Aniki::Plugin::PagerInjector - plus one pager injector

SYNOPSIS

package MyDB;
use Mouse v2.4.5;
extends qw/Aniki/;
with qw/Aniki::Plugin::PagerInjector/;

package main;
my $db = MyDB->new(...);

my ($page, $rows) = (1, 10);
my ($limit, $offset) = ($rows + 1, ($page - 1) * $rows);
my $result = $db->select('user', { type => 2 }, { limit => $limit, offset => $offset }); # => Aniki::Result::Collection
$result = $db->inject_pager_to_result($result => { # => inject Aniki::Result::Role::Pager
    table_name => 'user',
    rows       => $rows,
    page       => $page,
})
$result->pager; # => Data::Page::NoTotalEntries

SEE ALSO

perl Data::Page::NoTotalEntries

LICENSE

Copyright (C) karupanerura.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR

karupanerura <karupa@cpan.org>