On 6/3/07, Michael Bayer <[EMAIL PROTECTED]> wrote: > > > On Jun 3, 2007, at 10:49 AM, Christoph Haas wrote: > > > > > On Sat, Jun 02, 2007 at 01:09:37PM -0400, Michael Bayer wrote: > >> at Mike Orr's prodding, ive worked up a SQLAlchemy context object > >> based on his proposal for a facade that deals with the various > >> session > >> (context)/engine/metadata mixtures. I think this would be a good > >> idea for the very reason that it encapsulates all the details of how > >> engines/metadata/session/etc get created and used. [...] > >> > >> from pylons.database import SAContext > >> sac = SAContext() # connects to engine in the .ini file by default > >> [...] > > > > I like your prosal a lot. It addresses everything that has annoyed > > me so > > far. But why is it limited to pylons.database? Elixir tries to make SA > > simpler. Can't the session context itself be jazzed up so thar > > pylons.database does little more than read the sqlalchemy.dburi and > > provide a session context? > > i consider this facade to be a framework feature. it has an opinion > about how things should be organized. SA itself isnt a framework and > doesnt want strong opinions about how things should be organized, and > SessionContext is just a small building block towards an end-user > solution. im pretty sure making a rich facade out of SessionContext > would throw the zalchemy guys for a loop, for example.
I also think something like SAContext would make a good optional feature for SQLAlchemy, but I'd rather see it proven in Pylons first. There's also a get_engine_args() function which Michael didn't say much about but it's going to be a large percentage of the code. It's not just a matter of "sqlalchemy.dburi". There's also "sqlalchemy.pool_recycle" which is critical for MySQL, as well as the other engine options (or at least the scalar ones). It will also scale to multiple engines along the lines of "sqlalchemy.engine_key.dburi". This code is very Pylons specific, or at least it is until other frameworks/applications start using the same config file format. -- Mike Orr <[EMAIL PROTECTED]> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~----------~----~----~----~------~----~------~--~---