GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  CLASS::DBI::ABSTRACTSEARCH (3)

.ds Aq ’

NAME

Class::DBI::AbstractSearch - Abstract Class::DBI’s SQL with SQL::Abstract::Limit

CONTENTS

SYNOPSIS



  package CD::Music;
  use Class::DBI::AbstractSearch;

  package main;
  my @music = CD::Music->search_where(
      artist => [ Ozzy, Kelly ],
      status => { !=, outdated },
  );

  my @misc = CD::Music->search_where(
      { artist => [ Ozzy, Kelly ],
        status => { !=, outdated } },
      { order_by      => "reldate DESC",
        limit_dialect => LimitOffset,
        limit         => 1
        offset        => 2 });



DESCRIPTION

Class::DBI::AbstractSearch is a Class::DBI plugin to glue SQL::Abstract::Limit into Class::DBI.

METHODS

Using this module adds following methods into your data class.
search_where


  $class->search_where(%where);



Takes a hash to specify WHERE clause. See SQL::Abstract for hash options.



  $class->search_where(\%where,\%attrs);



Takes hash reference to specify WHERE clause. See SQL::Abstract for hash options. Takes a hash reference to specify additional query attributes. Class::DBI::AbstractSearch uses these attributes:
o <B>order_byB>

Array reference of fields that will be used to order the results of your query.

o <B>limit_dialectB>

Scalar, DBI handle, object class, etc. that describes the syntax model for a LIMIT/OFFSET SQL clause. Please see SQL::Abstract::Limit for more information.

o <B>limitB>

Scalar value that will be used for LIMIT argument in a query.

o <B>offsetB>

Scalar value that will be used for OFFSET argument in a query.

Any other attributes are passed to the SQL::Abstract::Limit constructor, and can be used to control how queries are created. For example, to use ’AND’ instead of ’OR’ by default, use:



    $class->search_where(\%where, { logic => AND });



AUTHOR

Tatsuhiko Miyagawa <miyagawa@bulknews.net> with some help from cdbi-talk mailing list, especially:



  Tim Bunce
  Simon Wilcox
  Tony Bowden



This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

Class::DBI, SQL::Abstract, SQL::Abstract::Limit

POD ERRORS

Hey! <B>The above document had some coding errors, which are explained below:B>
Around line 123: You forgot a ’=back’ before ’=head1’
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 CLASS::DBI::ABSTRACTSEARCH (3) 2005-10-06

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.