NAME
DBIx::DBH - Perl extension for simplifying database connections
ABSTRACT
DBIx::DBH is designed to facilitate and validate the process of creating DBI database connections. It's chief and unique contribution to this set of modules on CPAN is that it forms the DSN string for you, regardless of database vendor. Another thing about this module is that it takes a flat Perl hash as input, making it ideal for converting HTTP form data and or config file information into DBI database handles. It also can form DSN strings for both major free databases and is subclassed to support extension for other databases.
DBIx::DBH provides rigorous validation on the input parameters via Params::Validate. It does not allow parameters which are not defined by the DBI or the database vendor driver into the hash.
DBIx::DBH API
$dbh = connect(%params)
%params
requires the following as keys:
vendor : the value matches /\a(mysql|Pg)\Z/ (case-sensitive).
dbname : the value is the name of the database to connect to
%params
can have the following optional parameters
user
password
host
port
%params
can also have parameters specific to a particular database vendor. See DBIx::DBH::mysql and DBIx::DBH::Pg for additional parameters acceptable based on database vendor.
($dsn, $user, $pass, $attr) = connect_data(%params)
connect_data
takes the same arguments as connect()
but returns a list of the 4 arguments required by the DBI connect()
function. This is useful for working with modules that have an alternative connection syntax such as DBIx::AnyDBD or Alzabo.
SEE ALSO
Config::DBI =item * DBIx::Connect =item * DBIx::Password =item * Ima::DBI
AUTHOR
Terrence Brannon, <bauhaus@metaperl.com>
COPYRIGHT AND LICENSE
Copyright (C) 2004 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.