[sqlalchemy] bug? order_by + get(some_id) results in InvalidRequestError

2008-09-06 Thread Kyle Schaffrick
On Thu, 4 Sep 2008 18:54:27 -0400 Michael Bayer [EMAIL PROTECTED] wrote: as usual, since this one might turn out to be pretty controversial, I welcome the list to comment on this one. The order_by().get() idea does fall in the category of nonsensical as opposed to ambiguous , perhaps

[sqlalchemy] Re: Too many connections

2008-09-06 Thread gatto
On Sep 5, 12:19 pm, gatto [EMAIL PROTECTED] wrote: hi everyone. just started using sqlalchemy and elixir recently. i'm not having any issues with coding yet, just this one: OperationalError: (OperationalError) (1040, 'Too many connections') as a workaround for this problem, i created a

[sqlalchemy] Re: bug? order_by + get(some_id) results in InvalidRequestError

2008-09-06 Thread Michael Bayer
On Sep 6, 2008, at 7:35 AM, Kyle Schaffrick wrote: I imagine using the ambiguous discriminator instead of nonsensical might partition the various other query criteria a bit differently as well, but in my present state of mental capacity, order_by() is the only one I can think of that

[sqlalchemy] Re: Too many connections

2008-09-06 Thread Michael Bayer
On Sep 6, 2008, at 8:03 AM, gatto wrote: On Sep 5, 12:19 pm, gatto [EMAIL PROTECTED] wrote: hi everyone. just started using sqlalchemy and elixir recently. i'm not having any issues with coding yet, just this one: OperationalError: (OperationalError) (1040, 'Too many connections') as

[sqlalchemy] Re: Selectable mapping fails in polymorphic schema?

2008-09-06 Thread Michael Bayer
Maps to explicit joins are in any case going to integrate poorly with the joins created by SQLA's inheritance functionality. But in this case, no imitation of SQLA's join is needed: orm.mapper(Lab, inherits=Group, polymorphic_identity=ugroup_lab, ) On Sep 6, 2008, at 1:24 PM, Jason

[sqlalchemy] Selectable mapping fails in polymorphic schema?

2008-09-06 Thread Jason Yamada-Hanff
Below is a simplified case of a problem (bug?) I am running into. I have a polymorphic schema using joined-table inheritance. In my OO layer, a Group is an Agent, and a Lab is a Group. In the DB layer, Lab doesn't actually need to hold any extra information so it doesn't need a separate table.

[sqlalchemy] Re: timing all queries

2008-09-06 Thread qvx
On Aug 31, 11:36 pm, Michael Bayer [EMAIL PROTECTED] wrote: for a more comprehensive solution   write some timing code around ConnectionProxy, docstring athttp://www.sqlalchemy.org/docs/05/sqlalchemy_interfaces.html#docstrin... What would be the equivalent way in 0.4 version of sqlalchemy

[sqlalchemy] Re: Too many connections

2008-09-06 Thread gatto
On Sep 6, 9:27 am, Michael Bayer [EMAIL PROTECTED] wrote: On Sep 6, 2008, at 8:03 AM, gatto wrote: On Sep 5, 12:19 pm, gatto [EMAIL PROTECTED] wrote: hi everyone. just started using sqlalchemy and elixir recently. i'm not having any issues with coding yet, just this one:

[sqlalchemy] Re: Too many connections

2008-09-06 Thread Michael Bayer
On Sep 6, 2008, at 5:07 PM, gatto wrote: global phase try: if phase == 'start': phase = 'running' except: phase = 'start' if phase == 'start': self.engine = create_engine('mysql://' + app_config.database.user + ':' + app_config.database.password + '@'

[sqlalchemy] Re: timing all queries

2008-09-06 Thread Michael Bayer
On Sep 6, 2008, at 3:46 PM, qvx wrote: On Aug 31, 11:36 pm, Michael Bayer [EMAIL PROTECTED] wrote: for a more comprehensive solution write some timing code around ConnectionProxy, docstring athttp://www.sqlalchemy.org/docs/05/sqlalchemy_interfaces.html#docstrin ... What would be the

[sqlalchemy] Re: Selectable mapping fails in polymorphic schema?

2008-09-06 Thread Jason Yamada-Hanff
Thanks Michael, That worked great. I guess I missed that inheriting mappers don't need a table/selectable/join to map to. By the way, congrats on a great project. Your attention and effort are clear in every aspect (including the unheard-of speed of support)! On Sep 6, 3:04 pm, Michael

[sqlalchemy] Re: timing all queries

2008-09-06 Thread Domen Kožar
Maybe this could help: def timer(output=log.debug): @decorator def wrapper(fn, *a, **kw): start = time.time() result = fn(*a, **kw) end = time.time() delta = round(end - start, 3) output('Time needed to execute ' + fn.__name__ + '(): ' +