Terrence Brannon > metaperl-dbix-dbh-e0cfebd > DBIx::DBH

Download:
metaperl-dbix-dbh-e0cfebd.zip

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.5   Source  

NAME ^

 DBIx::DBH - helper for DBI connection( data)?

SYNOPSIS ^

 use DBIx::DBH;

 my $config = DBIx::DBH->new
   (
     user => $user,
     pass => $pass,
     dsn  => { driver => 'mysql', port => 3306 },
     attr => { RaiseError => 1 }
   );

 $config->for_skinny ; # outputs data structure for DBIx::Skinny setup
 $config->for_rose_db; # outputs data structure for Rose::DB::register_db
 $config->for_dbi;     # outputs data structure for DBI connect()
 $config->dbh;  # makes a database connection with DBI
 $config->conn; # makes a DBIx::Connector instance

ABSTRACT ^

DBIx::DBH allows you to specify the DBI dsn ( ""connect" in DBI ) as a hash ref instead of a string. A hashref is a more viable structure in a few cases:

METHODS ^

for_dbi

Returns data in a format suitable for calling DBI->connect.

dbh

Actually constructs a DBI database handle via DBI->connect.

conn

Actually constructs a DBIx::Connect database handle.

for_skinny

Returns data in a format suitable for using DBIx::Skinny.

for_rose_db

Returns data in a format suitable for using Rose::DB

Legacy Version ^

A procedural version of DBIx::DBH is still available as DBIx::DBH::Legacy.

An example extension ^

The file DBH.pm in DBIx::Cookbook is an example of deriving a connection class from DBIx::DBH -

http://github.com/metaperl/dbix-cookbook/blob/master/lib/DBIx/Cookbook/DBH.pm

SEE ALSO ^

Links

"Avoiding compound data in software and system design"

http://perlmonks.org/?node_id=835894

AUTHOR ^

Terrence Brannon, metaperl@gmail.com

thanks to Khisanth, Possum and DrForr on #perl-help

SOURCE CODE REPO

http://github.com/metaperl/dbix-dbh

COPYRIGHT AND LICENSE ^

Copyright (C) by Terrence Brannon

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or, at your option, any later version of Perl 5 you may have available.

syntax highlighting: