DBIx::Librarian

Manage SQL in repository outside code
Download

DBIx::Librarian Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Jason W. May
  • Publisher web site:
  • http://search.cpan.org/~jmay/

DBIx::Librarian Tags


DBIx::Librarian Description

Manage SQL in repository outside code DBIx::Librarian is a Perl module to manage SQL in repository outside code.SYNOPSIS use DBIx::Librarian; my $dblbn = new DBIx::Librarian; my $data = { id => 473 }; eval { $dblbn->execute("lookup_employee", $data); }; die $@ if $@; print "Employee $data->{id} is $data->{name} "; $dblbn->disconnect;OBJECTIVESSeparation of database logic from application logic (SQL from Perl)Simple interface - sacrifices some flexibility in exchange for code readability and development speedLeave SQL syntax untouched if possible; support any extensions that are supported by the underlying databaseSupport transaction capability if the database allows itThis is NOT an object-to-relational-mapping toolkit or a persistence framework. For that sort of thing, see SPOPS or any of several other excellent modules. The combination of DBIx::Librarian and Template Toolkit or one of the other templating packages will give the basis of a fairly comprehensive database-driven application framework. Here are some key features of "DBIx::Librarian": · Support full complexity of Perl associative data structures · Multiple SQL statements chained in a single execute() invocation. Use results from one call as inputs to the next. · Each execute() is automatically a transaction, comprising one or more statements per the above. Optional delayed commit to collect multiple invocations into a transaction. Note that if your database doesn't support transactions (e.g. vanilla mySQL), then you're still out of luck here. · Processing modes for select statements: exactly one row, zero-or-one, multiple rows (zero to many); optional exception on receiving multiple rows when expecting just one. SQL syntax is extended to provide these controls. · Support bind variables, and on-the-fly SQL generation through substitution of entire SQL fragments. · Supports multiple repositories for queries - currently supports individual files and multiple-query files. · Database connection can be passed into the Librarian initializer, or it will create it internally. · If the database connection is down when execute() is called, Librarian will attempt to re-connect. · Sets DBI LongReadLen and LongTruncOk to allow for fetching long values. Optional LONGREADLEN parameter to DBIx::Librarian::new will be passed through to DBI (default 1000). Requirements: · Perl


DBIx::Librarian Related Software