DBIx::SQLEngine::Driver

DBIx::SQLEngine::Driver is a DBI wrapper with driver subclasses.
Download

DBIx::SQLEngine::Driver Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Matthew Simon Cavalletto
  • Publisher web site:
  • http://search.cpan.org/~ferrency/

DBIx::SQLEngine::Driver Tags


DBIx::SQLEngine::Driver Description

DBIx::SQLEngine::Driver is a DBI wrapper with driver subclasses. DBIx::SQLEngine::Driver is a DBI wrapper with driver subclasses.SYNOPSISDBI Wrapper: Adds methods to a DBI database handle. $sqldb = DBIx::SQLEngine->new( $dbi_dsn, $dbi_user, $dbi_passwd ); $sqldb = DBIx::SQLEngine->new( $dbh ); # or use your existing handle $dbh = $sqldb->get_dbh(); # get the wraped DBI dbh $sth = $sqldb->prepare($statement); # or just call any dbh methodHigh-Level Interface: Prepare and fetch in one call. $row_count = $sqldb->try_query($sql, @params, 'get_execute_rowcount'); $array_ary = $sqldb->try_query($sql, @params, 'fetchall_arrayref'); $hash_ary = $sqldb->try_query($sql, @params, 'fetchall_hashref');Data-Driven SQL: SQL generation with flexible arguments. $hash_ary = $sqldb->fetch_select( table => 'students', where => { 'status'=>'minor' }, ); $sqldb->do_insert( table => 'students', values => { 'name'=>'Dave', 'age'=>'19', 'status'=>'minor' }, ); $sqldb->do_update( table => 'students', where => 'age > 20', values => { 'status'=>'adult' }, ); $sqldb->do_delete( table => 'students', where => { 'name'=>'Dave' }, );Named Definitions: Pre-define connections and queries. DBIx::SQLEngine->define_named_connections( 'test' => 'dbi:AnyData:test', 'production' => , ); DBIx::SQLEngine->define_named_queries( 'all_students' => 'select * from students', 'delete_student' => , ); $sqldb = DBIx::SQLEngine->new( 'test' ); $hash_ary = $sqldb->fetch_named_query( 'all_students' ); $rowcount = $sqldb->do_named_query( 'delete_student', $my_id );Portability Subclasses: Uses driver's idioms or emulation. $hash_ary = $sqldb->fetch_select( # uses database's limit syntax table => 'students', order => 'last_name, first_name', limit => 20, offset => 100, ); $hash_ary = $sqldb->fetch_select( # use "join on" or merge with "where" table => , where => { 'academic_year'=>'2004' }, ); $hash_ary = $sqldb->fetch_select( # combines multiple query results union => , ); $sqldb->do_insert( # use auto_increment/sequence column table => 'students', sequence => 'id', values => { 'name'=>'Dave', 'age'=>'19', 'status'=>'minor' }, ); Requirements: · Perl


DBIx::SQLEngine::Driver Related Software