Rose::DB::Object::QueryBuilderRose::DB::Object::QueryBuilder is a Perl module that can build SQL queries on behalf of Rose::DB::Object::Manager. | |
Download |
Rose::DB::Object::QueryBuilder Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- John C. Siracusa
- Publisher web site:
- http://search.cpan.org/~jsiracusa/
Rose::DB::Object::QueryBuilder Tags
Rose::DB::Object::QueryBuilder Description
Rose::DB::Object::QueryBuilder is a Perl module that can build SQL queries on behalf of Rose::DB::Object::Manager. Rose::DB::Object::QueryBuilder is a Perl module that can build SQL queries on behalf of Rose::DB::Object::Manager.SYNOPSIS use Rose::DB::Object::QueryBuilder qw(build_select); # Build simple query $sql = build_select ( dbh => $dbh, select => 'COUNT(*)', tables => , columns => { articles => }, query => , type => 'news', title => { like => }, ], query_is_sql => 1); $sth = $dbh->prepare($sql); $dbh->execute; $count = $sth->fetchrow_array; ... # Return query with placeholders, plus bind values ($sql, $bind) = build_select ( dbh => $dbh, tables => , columns => { articles => }, query => , type => 'news', title => { like => }, ], query_is_sql => 1, sort_by => 'title DESC, category', limit => 5); $sth = $dbh->prepare($sql); $dbh->execute(@$bind); while($row = $sth->fetchrow_hashref) { ... } ... # Coerce query values into the right format ($sql, $bind) = build_select ( db => $db, tables => , columns => { articles => }, classes => { articles => 'Article' }, query => , sort_by => 'title DESC, category', limit => 5); $sth = $dbh->prepare($sql); $dbh->execute(@$bind); Requirements: · Perl
Rose::DB::Object::QueryBuilder Related Software