DH a écrit :
In fact, this is nearly already the case. If your library is "Python
Database API Specification v2.0" compliant (see
http://www.python.org/peps/pep-0249.html) then you can just change the
connection object. But you need to take care of such thing like the
"paramstyle" parameters.
I've already use this to change from MySQL to ODBC with no change in the
code.
But the real pain is not the API, it is the SQL. For example an integer
will not be declare the same way in PostGres or MySQL, same for BLOB, etc.
That is why the only way is to do things in a more abstract way like
sqlobject or modeling. But I find it is still complicate to have a
persistent framework that can accept Database, ZODB, etc in a nice way...
Loïc