On Thu, Jun 16, 2011 at 10:17 AM, Peter Rabbitson <[email protected]> wrote:

> This won't be wrong - ->count returns how many objects you would receive
> via ->all/->next. If you want full count of the underlying source with
> all limits removed - keep the original resultset around. If you do not care
> about WHERE conditions either - $rs->result_source->resultset->count will
> do it for you.

Except it is wrong:

my $rs = $db->resultset('Employee::Job')->search(
    { period => '2010-02-28' },
    {
        rows => 100,
        offset => 100,
    }
);

print $rs->count; # 100, the number I'm looking for is 2023

So what it looks like I want to do is like you suggested, clone the
ResultSet and either get the WHERE clause out of the original or
remove the rows/offset attributes and/or add them in later. I just
don't see anything in the class's interface that will let me do that.

Thanks,

-- 
Dorian Taylor
http://doriantaylor.com/

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[email protected]

Reply via email to