OpenResty::SQL::Select - SQL generator for select statements
OpenResty::SQL::Select ISA OpenResty::SQL::Statement
use OpenResty::SQL::Select; my $select = OpenResty::SQL::Select->new; $select->select( qw<name type label> ) ->from( '_columns' ); $select->where("table_name", '=', _Q('blah')); $select->order_by("foo"); $select->where("Foo", '>', 'bar')->where('Bar' => '3'); print "$select"; # produces: # select name, type, label # from _columns # where table_name = 'blah' and Foo > bar and Bar = 3 # order by foo;
This class provides an OO interface for generating SQL select statements without the pain of concatenating plain SQL strings.
new(@columns)
from(@tables)
where($column =
order_by($column)
order_by($column =
limit($limit)
offset($offset)
generate
Agent Zhang (agentzh) <agentzh@yahoo.cn>
<agentzh@yahoo.cn>
OpenResty::SQL::Statement, OpenResty::SQL::Insert, OpenResty::SQL::Update, OpenResty.
To install OpenResty, copy and paste the appropriate command in to your terminal.
cpanm
cpanm OpenResty
CPAN shell
perl -MCPAN -e shell install OpenResty
For more information on module installation, please visit the detailed CPAN module installation guide.