[sqlalchemy] How do I turn this PostgreSQL upsert query into SQLAlchemy?

2012-08-20 Thread Mitchell Hashimoto
Hello, I have a need to perform an "upsert" query with PostgreSQL. the following SQL query achieves this goal: WITH upsert AS ( UPDATE metric k SET k.count = k.count + 5 WHERE event = "foo" AND interval = "D" and date = "whatever" RETURNING k.* ) INSERT INTO metric (event, interval, date, c

Re: [sqlalchemy] QueuePool limit size reached, using expression API only

2012-04-09 Thread Mitchell Hashimoto
On Mon, Apr 9, 2012 at 5:32 PM, Michael Bayer wrote: > > On Apr 9, 2012, at 8:24 PM, Mitchell Hashimoto wrote: > > > > On Monday, April 9, 2012 12:03:29 PM UTC-7, Michael Bayer wrote: >> >> close your connections after you are finished with them. > > > So

Re: [sqlalchemy] QueuePool limit size reached, using expression API only

2012-04-09 Thread Mitchell Hashimoto
tchell > > > On Apr 9, 2012, at 2:43 PM, Mitchell Hashimoto wrote: > > Hi, > > I am continually getting this sort of error after some amount of time: > QueuePool > limit of size 30 overflow 10 reached, connection timed out, timeout 30 > > We're using only

[sqlalchemy] QueuePool limit size reached, using expression API only

2012-04-09 Thread Mitchell Hashimoto
Hi, I am continually getting this sort of error after some amount of time: QueuePool limit of size 30 overflow 10 reached, connection timed out, timeout 30 We're using only the SQLAlchemy Core expressions API, so we're not wrapping anything in sessions, so I'm not sure how this is happening.