Class::DBI::Plugin::AbstractCount - get COUNT(*) results with abstract SQL


Class-DBI-Plugin-AbstractCount documentation  | view source Contained in the Class-DBI-Plugin-AbstractCount distribution.

Index


NAME

Top

Class::DBI::Plugin::AbstractCount - get COUNT(*) results with abstract SQL

SYNOPSIS

Top

  use base 'Class::DBI';
  use Class::DBI::Plugin::AbstractCount;

  my $count = Music::Vinyl->count_search_where(
    { artist   => 'Frank Zappa'
    , title    => { like    => '%Shut Up 'n Play Yer Guitar%' }
    , released => { between => [ 1980, 1982 ] }
    });

DESCRIPTION

Top

This Class::DBI plugin combines the functionality from Class::DBI::Plugin::CountSearch (counting objects without having to use an array or an iterator), and Class::DBI::AbstractSearch, which allows complex where-clauses a la SQL::Abstract.

METHODS

Top

count_search_where

Takes a hashref with the abstract where-clause. An additional attribute hashref can be passed to influence the default behaviour: arrayrefs are OR'ed, hashrefs are AND'ed.

TODO

Top

More tests, more doc.

SEE ALSO

Top

SQL::Abstract for details about the where-clause and the attributes.
Class::DBI::AbstractSearch
Class::DBI::Plugin::CountSearch

AUTHOR

Top

Jean-Christophe Zeus, <mail@jczeus.com> with some help from Tatsuhiko Myagawa and Todd Holbrook.

COPYRIGHT AND LICENSE

Top


Class-DBI-Plugin-AbstractCount documentation  | view source Contained in the Class-DBI-Plugin-AbstractCount distribution.