[Dbix-class] Getting a 'count' value
Denny
2009 at denny.me
Thu May 14 12:28:49 GMT 2009
On Thu, 2009-05-14 at 14:16 +0200, Emmanuel Quevillon wrote:
> I'd like to retrieve the value of a count returned by an SQL query.
>
> acc => $g->name(),
> num => $c->model('Table')->search({'id' => $g->id},<CODE>
>
> where I tried to replace <CODE> with :
>
> 1- )->all()
> 2- { select =>[{'count' => '*'}],as => ['cnt']
> })->next->get_column('cnt')
)->count
http://search.cpan.org/~ribasushi/DBIx-Class-0.08102/lib/DBIx/Class/ResultSet.pm#count_literal
and scroll up a little bit (for some reason the direct link to 'count' is broken)
More information about the DBIx-Class
mailing list