The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

OpenResty::SQL::Select - SQL generator for select statements

INHERITANCE

    OpenResty::SQL::Select
        ISA OpenResty::SQL::Statement

SYNOPSIS

    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;

DESCRIPTION

This class provides an OO interface for generating SQL select statements without the pain of concatenating plain SQL strings.

METHODS

new(@columns)
from(@tables)
where($column = $value)>
order_by($column) =item order_by($column = $direction)>
limit($limit)
offset($offset)
generate

AUTHOR

Agent Zhang (agentzh) <agentzh@yahoo.cn>

SEE ALSO

OpenResty::SQL::Statement, OpenResty::SQL::Insert, OpenResty::SQL::Update, OpenResty.