Class::DBI::Plugin::CountSearch - get COUNT(*) results from the database with search functionality


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

Index


NAME

Top

Class::DBI::Plugin::CountSearch - get COUNT(*) results from the database with search functionality

SYNOPSIS

Top

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

	my $count = My::Class->count_search('year' => '1994');

DESCRIPTION

Top

This plugin adds support for COUNT(*) results directly from the database without having to load the records into an iterator or array. It provides 'count_search' and 'count_search_like' which take arguments exactly like Class::DBI::search().

METHODS

Top

	my $count = My::Movies->count_search('year' => '1994');

This method will be exported into the calling class, and allows for retrieving a count of records using the Class::DBI::search() interface. The count is done using COUNT(*).

count_search_like

	my $count = My::Movies->count_search_like('title' => 'Jaws%');

This method will be exported into the calling class, and allows for retrieving a count of records using the Class::DBI::search_like() interface. The count is done using COUNT(*).

AUTHOR

Top

Todd Holbrook, <tholbroo@sfu.ca>.

Plugin importing and _do_count_search borrowed from Tony Bowden's Class::DBI and Class::DBI::Plugin::RetrieveAll.

COPYRIGHT

Top


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