DB and DBCompat

Jeroen Ruigrok/asmodai asmodai at wxs.nl
Sat Sep 6 08:34:18 UTC 2003

-On [20030906 10:12], Bradley Baetz (bbaetz at acm.org) wrote:
>My intention (not that its gone anywhere, given the limited time I've
>had to spend on Bugzilla recently) was for the dbcompat module to
>contain the bits which need to be explicitly used for cross-db support
>within string concatentation (eg SqlDate), but to leave the other stuff
>in Bugzilla::Db, overridden by Bugzilla::DB::mysql/Pg/etc transparently
>(eg connect).

Ok, so query related stuff in DBCompat and the rest in DB.  Works for

>I'm not sure that connect needs to be overloaded, however - all that we
>need is the DBD name, and DBI takes care of the rest, in theory.

Problem is, you need to overload it: DBD::mysql uses database=, DBD::Pg
uses dbname=, DBD::Oracle uses sid=, DBD::Sybase uses server= and/or
database=, Informix expects dbi:Informix:$database.

There's no standard way to specify the database you are connecting to.
It is asked of people to follow the ODBC standard, i.e. database=, but
it is not a requirement.

>I'm not too sure how realistic that is, though. Maybe we need to make a
>list of what sort of stuff we need in the compat module.

The way it looks now, it seems as if all database related code needs to
be made RDBMS agnostic, so I fear that both DB and DBCompat will have
if/elsif cases for all databases supported.

Jeroen Ruigrok van der Werven <asmodai(at)wxs.nl> / asmodai
PGP fingerprint: 2D92 980E 45FE 2C28 9DB7  9D88 97E6 839B 2EAC 625B
http://www.tendra.org/   | http://www.in-nomine.org/~asmodai/diary/
Don't fear dying, fear never having loved...

More information about the developers mailing list