NAME

OpenResty::SQL::Insert - SQL generator for insert statements

INHERITANCE

OpenResty::SQL::Insert
    ISA OpenResty::SQL::Statement

SYNOPSIS

use OpenResty::SQL::Insert;

my $insert = OpenResty::SQL::Insert->new;
$insert->insert( 'models' )
    ->values( 'abc' => '"howdy"' );
print "$insert";
    # produces: insert into models values (abc, "howdy");

$insert->cols('foo', 'bar');
print $insert->generate;
    # produces: insert into models (foo, bar) values (abc, "howdy");

DESCRIPTION

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

METHODS

new($table)
values(@values)
col(@column_names)

AUTHOR

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

SEE ALSO

OpenResty::SQL::Statement, OpenResty::SQL::Select, OpenResty::SQL::Update, OpenResty.