AlignDB::SQL - An SQL statement generator.
my $sql = AlignDB::SQL->new(); $sql->select([ 'id', 'name', 'bucket_id', 'note_id' ]); $sql->from([ 'foo' ]); $sql->add_where('name', 'fred'); $sql->add_where('bucket_id', { op => '!=', value => 47 }); $sql->add_where('note_id', \'IS NULL'); $sql->limit(1); my $sth = $dbh->prepare($sql->as_sql); $sth->execute(@{ $sql->{bind} }); my @values = $sth->selectrow_array(); my $obj = SomeObject->new(); $obj->set_columns(...);
AlignDB::SQL represents an SQL statement.
Most codes come from Data::ObjectDriver::SQL
with this, as_sql() method will replace strings in the final SQL statement
Sixapart
Qiang Wang <wang-q@outlook.com>
This software is copyright (c) 2008 by Qiang Wang.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install AlignDB::SQL, copy and paste the appropriate command in to your terminal.
cpanm
cpanm AlignDB::SQL
CPAN shell
perl -MCPAN -e shell install AlignDB::SQL
For more information on module installation, please visit the detailed CPAN module installation guide.