Ima::DBI

Ima::DBI is a Perl module for database connection caching and organization.
Download

Ima::DBI Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Tony Bowden and Perrin Harkins
  • Publisher web site:
  • http://search.cpan.org/~perrin/

Ima::DBI Tags


Ima::DBI Description

Ima::DBI is a Perl module for database connection caching and organization. Ima::DBI is a Perl module for database connection caching and organization.SYNOPSIS package Foo; use base 'Ima::DBI'; # Class-wide methods. Foo->set_db($db_name, $data_source, $user, $password); Foo->set_db($db_name, $data_source, $user, $password, %attr); my @database_names = Foo->db_names; my @database_handles = Foo->db_handles; Foo->set_sql($sql_name, $statement, $db_name); Foo->set_sql($sql_name, $statement, $db_name, $cache); my @statement_names = Foo->sql_names; # Object methods. $dbh = $obj->db_*; # Where * is the name of the db connection. $sth = $obj->sql_*; # Where * is the name of the sql statement. $sth = $obj->sql_*(@sql_pieces); $obj->DBIwarn($what, $doing); my $rc = $obj->commit; my $rc = $obj->commit(@db_names); my $rc = $obj->rollback; my $rc = $obj->rollback(@db_names);Ima::DBI attempts to organize and facilitate caching and more efficient use of database connections and statement handles by storing DBI and SQL information with your class (instead of as seperate objects). This allows you to pass around just one object without worrying about a trail of DBI handles behind it.One of the things I always found annoying about writing large programs with DBI was making sure that I didn't have duplicate database handles open. I was also annoyed by the somewhat wasteful nature of the prepare/execute/finish route I'd tend to go through in my subroutines. The new DBI->connect_cached and DBI->prepare_cached helped a lot, but I still had to throw around global datasource, username and password information.So, after a while I grew a small library of DBI helper routines and techniques. Ima::DBI is the culmination of all this, put into a nice(?), clean(?) class to be inherited from. Requirements: · Perl


Ima::DBI Related Software