[DB-SIG] Creating portable Python database code

alexander smishlajev alex@ank-sia.com
Thu, 24 Feb 2000 14:44:00 +0200


Christopher Petrilli wrote:
> 
> > in Perl DBI, moving to different database is as easy as changing
> > connection setting.  AFAIU the same is true for Zope.  but doing
> > this in Python seems to be much more tricky.  am i missing
> > something important?
> 
> It's not more complex in Python *IF* you keep your SQL compatible with
> whatever subset works on all platforms.  You just have to import a different
> module and instantiate the class... e.g.:
> 
> import DCOracle
> 
> conn = DCOracle.Connection(...)
> 
> to...
> 
> import Sybase
> 
> conn = Sybase.Connection(...)

ok.  i can import a module and create connection.  my problem is
with dates: i failed to find a consistent way to handle datetime
(or whatever this data type is called) values.

best wishes,
alex.