[DB-SIG] db module wrapper

Randall Smith randall at tnr.cc
Sun Aug 22 02:20:47 CEST 2004


Development Updates:

I having a working module with wrapping for qmark paramstyle, Python 
datetime objects (input and output), Exceptions (Kevin Jacob's 
solution), and date related module constructors.  I also moved database 
specific files into config files.  Modules that fully support DB API2 
should not need config files.  In testing, both cx_Oracle and psycopg 
work without config files, but have some caveats.  Without configs, 
cx_Oracle dates are converted via mx.DateTime's string parser (not 
optimal) and a backslash escape in a query will fail with psycopg (not 
psycopg's fault).  MySQLdb requires a config to set the DATETIME type.

I've set threadsafety = 0 and just passing description through.  I need 
to do something with description. Should I standardize the description 
type_code?

Extras:

db_row - If you have db_row in your path, you can have results formatted 
with it.

I also had some other ideas.  I'm going to make module.paramstyle and 
module.DATETIME writable.  For example, module.paramestyle = 'named' 
will allow you to use named parameters and so on supporting all 5 
paramstyles.  For DATETIME, I will support mx.DateTime and Zope date 
objects.  Changing the DATETIME attribute will change both input and 
output of dates.  The input being paramaters in param queries.  Note 
that all these things are still 'ideas', but I think they are feasible.

The code is very unfinished, so I'm not going to make a release now, but 
if you want to have a look and/or test it out, let me know and I'll send 
it to you directly.  It is a single module, dball, plus configs.

Randall


More information about the DB-SIG mailing list