[Zope-dev] Re: straighting out the SQLAlchemy integration mess

Andreas Jung lists at zopyx.com
Fri Apr 11 07:27:15 EDT 2008



--On 11. April 2008 08:36:43 +0100 Martin Aspeli <optilude at gmx.net> wrote:

> Martijn Faassen wrote:
>> Andreas Jung wrote:
>>> --On 10. April 2008 19:10:49 +0200 Brian Sutherland
>>> <brian at vanguardistas.net> wrote:
>>>> Just adding my few requirements:
>>>>     - Integration into the component architecture in such a way that I
>>>>       can specify the db connection parameters in ZCML and that
>>>>       database reflection still works. I want to be able to get a
>>>>       handle on
>>>> SQLAlchemy       things by calling getUtility.
>>> Please *NO* database specific configurations within ZCML. We're running
>>> applications in up three or four different environments and I don't
>>> want  to maintain instance specific configurations within ZCML. Either
>>> we pass such informations through environment variables or the database
>>> connections parameters are read from a configuration within the
>>> instance  configuration.
>>
>> As long as it can also be specified in the code, that way people can
>> build UIs to set up the connection. Perhaps that's what you mean by a
>> "configuration within the instance configuration".
>
> The way I use collective.lead in my book is to have it look up the
> database settings in a local utility. That utility is editable via a
> control panel page in Plone. I suspect that it'd be quite easy to do
> something similar where the settings were deferred to a global utility
> configured with ZCML or looked up in a config file of some sort.
>
> Once the config is available, it's all about calling getUtility() to get
> hold of a database connection/session.


Possibly a sane and clean solution but way of over-designed. I am 
interested in simple and robust solutions that work and not in a solution 
that adds more and more unnecessary layers just the sake of having them :-)

Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope-dev/attachments/20080411/a65fda83/attachment.bin


More information about the Zope-Dev mailing list