Get count(*) results with abstract sql
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 ] } });
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.
Takes a hashref with the abstract where-clause. An additional attribute hashref can be passed to influence the default behaviour: arrayrefs are \s-1OR\s0'ed, hashrefs are \s-1AND\s0'ed.
More tests, more doc.
Jean-Christophe Zeus, <[email protected]> with some help from Tatsuhiko Myagawa and Todd Holbrook.
Copyright (C) 2004 by Jean-Christophe Zeus
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.