Search::QueryParser::SQL::Column - SQL column object
my $column = Search::QueryParser::SQL::Column->new( name => 'foo', type => 'char', alias => 'bar', fuzzy_op => 'ILIKE', fuzzy_not_op => 'NOT ILIKE', callback => sub { my ($col, $op, $val) = @_; return "$col $op $val"; }, orm_callback => sub { my ($col, $op, $val) = @_; return( $col => { $op => $val } ); }, );
This class represents a column in a database table, and is used for rendering SQL correctly.
Only new or overridden method are documented here.
Instantiate a new Column object. args may be a hash or hashref.
args keys are also accessor methods:
The column name. Stringifies to this value.
SQL column type: char, varchar, integer, datetime, timestamp, etc.
Alternate names for the column. May be a scalar string or array ref.
The operator to use when a column value has a wildcard attached. For text columns this defaults to ILIKE. For numeric columns this defaults to ">=".
ILIKE
The operator to use when a column value has a wildcard attached and is negated. For text columns this defaults to NOT ILIKE. For numeric columns this defaults to "! >=".
NOT ILIKE
Should be a CODE reference expecting three arguments: the Column object, the operator in play, and the value. Should return a string to be pushed onto the Query buffer.
Like callback but should return a pair of values: the column name and either a value or a hashref with the operator as the key.
Returns Column name. Column objects overload to this method.
Peter Karman, <karman@cpan.org>
<karman@cpan.org>
Please report any bugs or feature requests to bug-search-queryparser-sql@rt.cpan.org, or through the web interface at http://rt.cpan.org. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-search-queryparser-sql@rt.cpan.org
The Minnesota Supercomputing Institute http://www.msi.umn.edu/ sponsored the development of this software.
http://www.msi.umn.edu/
Copyright 2008 by the Regents of the University of Minnesota.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Search::QueryParser::SQL, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Search::QueryParser::SQL
CPAN shell
perl -MCPAN -e shell install Search::QueryParser::SQL
For more information on module installation, please visit the detailed CPAN module installation guide.