[Zope3-dev] Changing zope.app.rdb to better support sqlos

Andres Freund andres at anarazel.de
Thu Nov 3 06:08:09 EST 2005


Hi,

im using sqlos with zope3 which is for itself no problem.
People who worked with sqlos might know, that you have to change an 
adapter in sqlos's configure.zcml acording to which database you use.
This is so, because sqlobject, on which sqlos is built up, has to know 
which database it uses as it generates SQL for them. So no alternative 
i see can change the fact, that it has to know which database is used.
I see four possible solutions to this:

1. Move sqlobject into zope.app.rdb/into the database connectors.
While this would open some neat possibilities, i dont think anybody 
will see this as an real possibility, as it is bloat and way too much 
work.

2. Have sqlos extract which database is used out of the classname of 
the connection.
This works (it is working in a branch now), but is not very elegant, 
propably failure prone, and doesnt use zope addaption, but the database 
adapters doesnt have to be changed.

3. Have ever single adapter reimplement some type method.
This would work, but would still not use zope adaption and all database 
adapters would have to be changed.

4. Every database adapter has an own interface which inherits from the 
zope one. This would enable the use of normal zope adaption which i 
would prefer, but again every adapter which should be used together 
with sqlos has to be changed.


There is also one other problem. Sqlobject needs to have the database 
module in order to do binary uploads and other things. But as far as i 
looked i cant extract that one out of the zope.app.rdb adapter, or? 
Wouldnt it be better if the database module would be provided in 
.module or something?


Andres Freund


More information about the Zope3-dev mailing list