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

2008-04-11 Thread Martin Aspeli
Martijn Faassen wrote: 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

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

2008-04-11 Thread Brian Sutherland
On Fri, Apr 11, 2008 at 05:07:56AM +0200, Andreas Jung wrote: --On 10. April 2008 21:29:43 +0200 Brian Sutherland [EMAIL PROTECTED] wrote: 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

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

2008-04-11 Thread Andreas Jung
--On 11. April 2008 10:09:16 +0200 Brian Sutherland [EMAIL PROTECTED] wrote: On Fri, Apr 11, 2008 at 05:07:56AM +0200, Andreas Jung wrote: --On 10. April 2008 21:29:43 +0200 Brian Sutherland [EMAIL PROTECTED] wrote: What defines if something is the instance configuration? Isn't ZCML just

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

2008-04-11 Thread Andreas Jung
--On 11. April 2008 08:36:43 +0100 Martin Aspeli [EMAIL PROTECTED] wrote: Martijn Faassen wrote: 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

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

2008-04-11 Thread Martin Aspeli
Andreas Jung lists at zopyx.com writes: 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

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

2008-04-11 Thread Martijn Faassen
Brian Sutherland wrote: [snip] Unfortunately, it doesn't seem an option, right now, to avoid using ZCML to setup database connections. So I'm not sure how you want to implement your ideas? collective.lead can do it without ZCML; you set up the right connection by implementing a 'url' property

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

2008-04-11 Thread Martijn Faassen
Andreas Jung wrote: [snip] 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 :-) It's a 1 liner to set up the connection in this

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

2008-04-11 Thread Reinout van Rees
Brian Sutherland schreef: Unfortunately, it doesn't seem an option, right now, to avoid using ZCML to setup database connections. So I'm not sure how you want to implement your ideas? Something we did for an LDAP connection that needed the same kind of server-dependent config: put an

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

2008-04-11 Thread Bernd Dorn
On 11.04.2008, at 10:09, Brian Sutherland wrote: Unfortunately, it doesn't seem an option, right now, to avoid using ZCML to setup database connections. So I'm not sure how you want to implement your ideas? +1 k, i didn't read the whole thread, but we (lovely systems) use zope.storm

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

2008-04-11 Thread Martijn Faassen
Bernd Dorn wrote: [whether configuration should be in ZCML] although it is a few lines of code to get db uris from somewhere else, and this could also be application code. I'm not against ZCML, as long as those lines of code to get the db URI from application code also exist. A good API to

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

2008-04-11 Thread Stephan Richter
On Friday 11 April 2008, Bernd Dorn wrote: although it is a few lines of code to get db uris from somewhere else,   and this could also be application code if you use paster, you can stick options into your pater ini script. We are currently doing this for a setting in our app. Regards,

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

2008-04-11 Thread Brian Sutherland
On Fri, Apr 11, 2008 at 01:21:45PM +0200, Andreas Jung wrote: Unfortunately, it doesn't seem an option, right now, to avoid using ZCML to setup database connections. So I'm not sure how you want to implement your ideas? I have no need for ideas to be implemented. We're using SA within in

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

2008-04-10 Thread Martijn Faassen
Martin Aspeli wrote: [snip] It's never particularly pleasant. I think we need to make sure we make this as easy and pleasant as possible though. This means at the very least some document that tells you what to do. :) Regards, Martijn ___

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

2008-04-10 Thread Laurence Rowe
Martin Aspeli wrote: Laurence Rowe wrote: Should one phase commit be set as the default to make it easier to work with sqlite (and mssql)? Probably yes. Ideally we'd guess based on the URL scheme but allow it to be set explicitly, IMHO. Single phase would be the fallback, I guess. I don't

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

2008-04-10 Thread Laurence Rowe
Martin Aspeli wrote: Martijn Faassen wrote: Martijn Pieters wrote: On Tue, Apr 8, 2008 at 11:54 PM, Martijn Faassen [EMAIL PROTECTED] wrote: All of these are in various states of brokenness. z3c.zalchemy doesn't work with SQLAlchemy trunk. collective.lead works with it, but only if you

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

2008-04-10 Thread Brian Sutherland
On Wed, Apr 09, 2008 at 05:47:06PM +0200, Andreas Jung wrote: --On 9. April 2008 14:15:38 +0100 Laurence Rowe [EMAIL PROTECTED] wrote: @everyone: If we can all agree to use the same basic session and transaction management then we should probably push for it to be included as a sqlalchemy

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

2008-04-10 Thread Andreas Jung
--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

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

2008-04-10 Thread Brian Sutherland
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

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

2008-04-10 Thread Brian Sutherland
On Thu, Apr 10, 2008 at 09:29:43PM +0200, Brian Sutherland wrote: On Thu, Apr 10, 2008 at 07:31:54PM +0200, Andreas Jung wrote: 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

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

2008-04-10 Thread Kapil Thangavelu
On Thu, Apr 10, 2008 at 1:31 PM, Andreas Jung [EMAIL PROTECTED] 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

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

2008-04-10 Thread Martijn Faassen
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

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

2008-04-10 Thread Andreas Jung
--On 10. April 2008 21:29:43 +0200 Brian Sutherland [EMAIL PROTECTED] wrote: 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

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

2008-04-09 Thread Martin Aspeli
Martijn Faassen wrote: Hi there, [I originally picked this up on a thread on zope3-users, but this deserves its own thread here] There are at least three approaches to SQLAlchemy integration with Zope: * z3c.zalchemy (Christian Theune) * z3c.sqlalchemy (Andreas Jung) * collective.lead

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

2008-04-09 Thread Laurence Rowe
The transaction manager here: http://svn.plone.org/svn/collective/collective.lead/branches/elro-tpc/collective/lead/tx.py Has support for TPC and savepoints. It is tested and works. The only issue with sqlite is that the default in the branch is to use two-phase commit and sqlite does not

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

2008-04-09 Thread Martijn Faassen
Martijn Pieters wrote: On Tue, Apr 8, 2008 at 11:54 PM, Martijn Faassen [EMAIL PROTECTED] wrote: All of these are in various states of brokenness. z3c.zalchemy doesn't work with SQLAlchemy trunk. collective.lead works with it, but only if you check out a particular branch, and not with sqlite.

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

2008-04-09 Thread Andreas Jung
--On 9. April 2008 14:15:38 +0100 Laurence Rowe [EMAIL PROTECTED] wrote: @everyone: If we can all agree to use the same basic session and transaction management then we should probably push for it to be included as a sqlalchemy extension module. I would be happy with such a solution. As

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

2008-04-09 Thread Kapil Thangavelu
On Wed, Apr 9, 2008 at 9:15 AM, Laurence Rowe [EMAIL PROTECTED] wrote: The transaction manager here: http://svn.plone.org/svn/collective/collective.lead/branches/elro-tpc/collective/lead/tx.py Has support for TPC and savepoints. It is tested and works. The only issue with sqlite is that

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

2008-04-09 Thread Martin Aspeli
Laurence Rowe wrote: Should one phase commit be set as the default to make it easier to work with sqlite (and mssql)? Probably yes. Ideally we'd guess based on the URL scheme but allow it to be set explicitly, IMHO. Single phase would be the fallback, I guess. Should the default be for

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

2008-04-09 Thread Martin Aspeli
Martijn Faassen wrote: Martijn Pieters wrote: On Tue, Apr 8, 2008 at 11:54 PM, Martijn Faassen [EMAIL PROTECTED] wrote: All of these are in various states of brokenness. z3c.zalchemy doesn't work with SQLAlchemy trunk. collective.lead works with it, but only if you check out a particular

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

2008-04-09 Thread Martin Aspeli
Andreas Jung wrote: --On 9. April 2008 14:15:38 +0100 Laurence Rowe [EMAIL PROTECTED] wrote: @everyone: If we can all agree to use the same basic session and transaction management then we should probably push for it to be included as a sqlalchemy extension module. I would be happy with

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

2008-04-09 Thread Andreas Jung
--On 10. April 2008 01:57:12 +0100 Martin Aspeli [EMAIL PROTECTED] wrote: Andreas Jung wrote: --On 9. April 2008 14:15:38 +0100 Laurence Rowe [EMAIL PROTECTED] wrote: @everyone: If we can all agree to use the same basic session and transaction management then we should probably push for