Class::DBI::Search::LIMITed - add 'LIMIT' to Class::DBI searches


Class-DBI-Search-LIMITed documentation  | view source Contained in the Class-DBI-Search-LIMITed distribution.

Index


NAME

Top

Class::DBI::Search::LIMITed - add 'LIMIT' to Class::DBI searches

SYNOPSIS

Top

	use base 'Class::DBI';

	__PACKAGE__->add_searcher(
		limited_search => 'Class::DBI::Search::LIMITed'
	);

	my @by_date = My::Class->limited_search( ... , {
			order_by => 'name',
			limit    => 10,
	});

	# or, if you want it to be the default search

	__PACKAGE__->add_searcher(
		search => 'Class::DBI::Search::LIMITed'
	);

	my @by_date = My::Class->search( ... , {
			order_by => 'name',
			limit    => '20, 10',
	});

DESCRIPTION

Top

This is a simple search plugin to a Class::DBI subclass which allows for the addition of a LIMIT option to a SELECT query.

METHODS

Top

add_searcher

	__PACKAGE__->add_searcher(
		method_name => 'Class::DBI::Search::LIMITed'
	);

As with all Search plugins you can choose the method name for the search that it generates. You can either make a distinct limit-ed search method (e.g. search_limited()), or just make it your default search() method.

fragment

This overrides the default 'fragment' method in Class::DBI::Search::Basic to add any 'limit' option passed in your search query.

CAVEATS

Top

This is only useful for databases which support a LIMIT modifier, such as MySQL.

AUTHOR

Top

Tony Bowden

BUGS and QUERIES

Top

Please direct all correspondence regarding this module to: bug-Class-DBI-Search-LIMITed@rt.cpan.org

COPYRIGHT AND LICENSE

Top


Class-DBI-Search-LIMITed documentation  | view source Contained in the Class-DBI-Search-LIMITed distribution.