|
|
| Think about Loose Coupling | |
| PerlMonks |
Re^2: DBI:how to get name of the db ?by erix (Priest) |
| on Dec 14, 2011 at 10:41 UTC ( #943522=note: print w/ replies, xml ) | Need Help?? |
|
It turns out that $dbh->{'Name'} is not a reliable source for the database name; DBI docs say: Holds the "name" of the database. Usually (and recommended to be) the same as the "dbi:DriverName:..." string used to connect to the database, but with the leading "dbi:DriverName:" removed. DBD::Pg complies wth that description: it simply returns the connectionstring minus the prefix. So it would seem that if $dbh->{'Name'} returns the database name it's by accident.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||