I am in somewhat of a pickle right now.
SQL::Catalog is written to work with DBIx::AnyDBD, but
DBIx::Password, by policy, will only return a database connection
not database connection information. However, the DBIx::AnyDBD
constructor requires connection information not a connected $dbh.
I currently auto-generate a module called SQL::Catalog::Config at
install time with DSN info, but would rather use a standard CPAN
module for this.
One solution is for the DBIx::AnyDBD constructor to take a "dbh
factory argument":
my $dbh = DBIx::AnyDBD->connect( sub
{ DBIx::Password->connect('cgi-dev') }, 'MyClass' ) ;
$dbh->foo; $dbh->blee;
The other option is to subclass DBIx::Password with a new module
which has one more method which returns connection information.
I need feedback on if this is a good idea and also on module
naming. Here's how i see it:
package DBIx::Passwd;
use DBIx::Password;
our @ISA = qw(DBIx::Password);
sub new { ... SUPER->new(@_) }
sub connect_info {
...
}
1;
A final option is to use App::Config instead of DBIx::Password... hmmm.
On Sat, 2002-02-02 at 09:01, Terrence Brannon wrote:
> Hi, I dont remember what happened anymore. But I believe I mailed
> you a patch so that DBIx::Password would work with DBIx::AnyDBD.
You did and I never got to it.
> we simply need the connection information so that it can be
> passed onto the DBIx::AnyDBD's constructor like so:
Here is the thing, one of the ideas behind DBIx::Password was to keep
users from actually being able to get the information out of the module
(its possibly to defeat this by just reading the file, but its one more
step and someday I am going to even make that a bit more difficult).
So I don't want to add a method to return the information. How about
having DBIx::Password just inherit DBIx::AnyDBD as needed and returning
it directly?
-Brian
--
_______________________________________________________
Brian Aker, [EMAIL PROTECTED]
Slashdot Senior Developer
Seattle, Washington
http://tangent.org/~brian/
http://askbrian.org/
_______________________________________________________
You can't grep a dead tree.
<hacker language="Perl" type="AxKit" uniqueness="just another">
Terrence Brannon
</hacker>