SPUG: Runtime binding, drivers

Ben Reser ben at reser.org
Thu Oct 10 20:40:32 CDT 2002


On Thu, Oct 10, 2002 at 05:20:18PM -0700, Trevor Leffler wrote:
> So you'd say that in practice, DBI doesn't really live up to the hype of 
> "Don't change a line of code!  One DB interface uber alles!"  Is this a 
> failing of DBI, and if you were to redesign the API, could you fix it?  
> Rather, it sounds like what you're saying is that, yes, these two things 
> are DBs, but they are so dissimilar that no API could be designed to unify 
> to two.

DBI never claimed you didn't have to change a line of code.  The jist is
that you get a nearly identical interface for multiple database engines.
If you are very careful and only use features that are supported by all
the databases and their drivers it is hypothetically possible to move
from one database to another without changing your code.  But in the
real world we use such features.  Fortunately, DBI makes the pain of
switching much less painful than it would be if we had to switch from
one entirely proprietary interface to another.

In order for DBI to guarantee no changes to your code to switch it would
have to only support the features that all the databases and drivers
support.  Which probably wouldn't be very desireable.  

Basically DBI provides you enough rope to hang yourself if you want.
But it's entirely up to you to do that.

-- 
Ben Reser <ben at reser.org>
http://ben.reser.org

Never take no as an answer from someone who isn't authorized to say yes.

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
     Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org




More information about the spug-list mailing list