Because AnyDBD needs to handle $dbh connection creation, it is 
necessary for DBIx::Password to return the connection information 
hash instead of conveniently making the connection.

Thus a new function connection_for was coded, so that you can do this:

use DBIx::AnyDBD;
use DBIx::Password;

my $c = DBIx::Password->connection_for('username');
my $db = DBIx::AnyDBD->connect($c->{connect},
                $c->{username}, $c->{password}, {}, "MyClass");

Here's the patch Brian. I hope you integrate them into 
DBIx::Password. Thanks

It would also be interesting to hear what Matt has to say about 
the utility/redundancy of the getDriver method with related 
AnyDBD support functions.

5,6c5,6
< #@DBIx::Password::ISA = qw ( DBI::db );
< ($DBIx::Password::VERSION) = ' $Revision: 1.8 $ ' =~ 
/\$Revision:\s+([^\s]+)/\
;
---
 > @DBIx::Password::ISA = qw ( DBI::db );
 > ($DBIx::Password::VERSION) = ' $Revision: 1.7 $ ' =~ 
/\$Revision:\s+([^\s]+)/\
;
11,17d10
<
< sub connection_for {
<       my ($class, $user, $options) = @_;
<       return undef unless defined($virtual1->{$user});
<       $virtual1->{$user};
< }
<

Reply via email to