[DB-SIG] what is: backwards compatibility

Carl Karsten carl at personnelware.com
Thu Jun 21 17:02:06 CEST 2007


When we talk about backwards compatibility, I am wondering exactly what that means.

I think my question is: should code that does not follow the dbapi2 spec be 
guaranteed to work?

For instance, I know some of the dbapiv2 modules support more than one 
paramstyle, yet the spec really only allows the one defined by .paramstyle.  So 
if application code uses some other paramstyle, does backwards compatibility 
mean the application code should still work?

To me, the dbapi2 paramstyle 'spec' was so poorly defined that it is impossible 
to be compatible with it and implement some of the changes we are considering, 
regardless of how big the backwards compatibility umbrella is.

I tried to write code once that made use of paramstyle:

x='MySQLdb'
dbapi=__import__(x)
if dbapi.paramstyle= ...

and gave up.

Granted I was trying to work with existing application code that had methods like

def getPKWhare(self,x):
  return "%s = %s" % (self.PKFieldName, self.SqlString(x))

The experience of working with code like that may have scared me into thinking 
the dbapi2 .paramstyle thing is worse than it really is, but others have agreed 
that it is pretty bad.

I am wondering if there is really _any_ code out there that can survive 
paramstyle changes.

I also wouldn't be surprised if 100% of the people who we are trying to 'help' 
would rather re-write their code to be simpler.

Carl K


More information about the DB-SIG mailing list