On Thu, Apr 10, 2008 at 07:31:54PM +0200, Andreas Jung wrote: > > > --On 10. April 2008 19:10:49 +0200 Brian Sutherland > <[EMAIL PROTECTED]> 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.
What defines if something is the instance configuration? Isn't ZCML just another format of configuration file? I agree it's evil to hardcode database connections in the application as they must be under the control of the sysadmin. But that doesn't preclude them from being expressed in zcml. I *do* like the idea of using one and only one file format to configure applications. We also run the in a few different environments, the /etc/myserver/site.zcml is different on a per instance basis and looks like this: <configure xmlns="http://namespaces.zope.org/zope" xmlns:rdb="http://namespaces.zope.org/rdb"> <include package="mymodule" file="configure.zcml" /> <rdb:provideConnection name="admin" component="psycopg2da.adapter.Psycopg2Adapter" dsn="dbi://prototype" /> </configure> But, I'm diverging, my point is that it would be nice to be able to have SQLAlchemy connections available as IZopeDatabaseAdapter utilities to allow a migration path. Whether they are defined in or out of ZCML, I just don't care. -- Brian Sutherland _______________________________________________ Zope-Dev maillist - [email protected] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
