On 20 Jul 2003 22:53:00 +0200, Claus Färber <[EMAIL PROTECTED]> wrote:

Tim Bunce <[EMAIL PROTECTED]> schrieb/wrote:
The DBI has a (currently private) method to determine the underlying
database type. It was borrowed from DBIx::AnyDBD. Take a look at
_dbtype_names() in DBI.pm

Yeah, I just updated DT::F::DBI to use that function.


I intend to extend it to use $dbh->get_info(17); (=SQL_DBMS_NAME),
and give it a public api, in the medium term.

One of the problems I can see is that it just returns the type ODBC returns, which is already a problem for MySQL (returns /^mysqld-.*/[1])

That is an issue. But that's part of the reason why _dbtype_names() returns an ordered list. For "mysqld-foo-bar" it may return something like ("mysqld-foo-bar", "mysqld-foo", "mysqld").

and PostgreSQL (returns 'PostgreSQL', not 'Pg'[1]).
I'm not sure what DBD::PgPP and DBD::PgSPI return, either.

Maybe DBI::_dbtype_names should normalise these DBMS names
(e.g. to the  corresponding DBD::* driver name, if one exists).

More likely that the DBI would supply a module that provides mapping between the sets of names.

BTW, is there a CVS server for DBI somewhere?

No. One day...


Tim.

Claus

[1] I have only looked at unixODBC's source code and not installed it,
so I might be wrong there.






Reply via email to