[sqlalchemy] The number of connection exceeded

2011-01-27 Thread Eduardo
Dear all, I am writing an application to scan a directory system and store metadata in DB. For each directory I create a separate process in which scanning and metadata feed is performed. Now I have following problems: 1) I am forced to start a session in each process and bind them for the engine

[sqlalchemy] logging bug in 0.6.6?

2011-01-27 Thread Jon Nelson
I'm trying to diagnose an issue with temporary tables, so I cranked up the debug levels to DEBUG. I noticed something strange: 2011-01-27 09:34:12,818 DEBUG [sqlalchemy.pool.QueuePool.0x...e410] Connection connection object at 0x12e1d50; dsn: 'dbname=BLAH host=localhost user=BLAH

Re: [sqlalchemy] logging bug in 0.6.6?

2011-01-27 Thread Michael Bayer
On Jan 27, 2011, at 10:38 AM, Jon Nelson wrote: I'm trying to diagnose an issue with temporary tables, so I cranked up the debug levels to DEBUG. I noticed something strange: 2011-01-27 09:34:12,818 DEBUG [sqlalchemy.pool.QueuePool.0x...e410] Connection connection object at 0x12e1d50;

Re: [sqlalchemy] Pass query with as parameter (avoid creating a method and hardcoding a query)

2011-01-27 Thread Hector Blanco
2011/1/16 Tamás Bajusz gbt...@gmail.com: Is your work available, or do you plan to put it public somewhere? Mmm... maybe... contact me privately if you're interested -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send

Re: [sqlalchemy] autocommit on for DDL

2011-01-27 Thread A.M.
On Jan 26, 2011, at 7:47 PM, Michael Bayer wrote: On Jan 26, 2011, at 6:32 PM, A.M. wrote: Well, I spoke too soon :( What is the mistake in the following sample code which causes the COMMITs to be emitted? Setting autocommit to either True or False emits the same SQL. I think this is a

Re: [sqlalchemy] The number of connection exceeded

2011-01-27 Thread Michael Bayer
On Jan 27, 2011, at 5:11 AM, Eduardo wrote: Dear all, I am writing an application to scan a directory system and store metadata in DB. For each directory I create a separate process in which scanning and metadata feed is performed. Now I have following problems: 1) I am forced to start a

Re: [sqlalchemy] Pass query with as parameter (avoid creating a method and hardcoding a query)

2011-01-27 Thread Tamás Bajusz
Sorry for late reply, but I was rather busy with real life work. I believe your code will be useful for me and for others too. Anyhow, thank you very much for it! On Thu, Jan 27, 2011 at 5:17 PM, Hector Blanco white.li...@gmail.com wrote: 2011/1/16 Tamás Bajusz gbt...@gmail.com: Is your work

[sqlalchemy] datetime interval to a number..

2011-01-27 Thread Petra Clementson
hi all, I've been trying to work out some SQLalchemy code to query two datetime columns and choose the one closest in time. I have some code that does this, but it requires using PostgreSQL and looks a little messy: query = query.order_by(ABS(EXTRACT(EPOCH FROM (header.utdatetime -

Re: [sqlalchemy] Multi-get?

2011-01-27 Thread Yang Zhang
Yeah, that's what we do right now. On Wed, Jan 26, 2011 at 8:03 PM, Mike Conley mconl...@gmail.com wrote: On Wed, Jan 26, 2011 at 8:17 PM, Yang Zhang yanghates...@gmail.com wrote: Is there something similar to the .get() method in SqlSoup and Session but which allows me to fetch more than

[sqlalchemy] Compound Join

2011-01-27 Thread Eric N
I'm trying to construct a query where in the from clause I would end up with something like SELECT foo FROM table1 JOIN table2 ON table1.id1 = table2.id1 JOIN table3 ON table1.id1=table3.id1 JOIN table4 ON table2.id2=table4.id2 AND table3.id3=table4.id3 I have

[sqlalchemy] counting queries

2011-01-27 Thread NiL
Hi all, I have an application replying on sqlalchemy that deals with many recursive methods. We manipulate complex graphs. I have tests that validates we get the expected results for each method. Still, many optimization might be done to the code. What I would like is, in my test environment,

Re: [sqlalchemy] counting queries

2011-01-27 Thread Michael Bayer
On Jan 27, 2011, at 8:12 PM, NiL wrote: Hi all, I have an application replying on sqlalchemy that deals with many recursive methods. We manipulate complex graphs. I have tests that validates we get the expected results for each method. Still, many optimization might be done to the

Re: [sqlalchemy] datetime interval to a number..

2011-01-27 Thread Michael Bayer
you can emit that exact SQL using func.abs() in conjunction with the extract() function, which is a standalone SQLA construct. from sqlalchemy import func, extract func.abs(extract('epoch', header.udatetime - self.header.udatetime)) On Jan 27, 2011, at 4:21 PM, Petra Clementson wrote: hi

Re: [sqlalchemy] Compound Join

2011-01-27 Thread Michael Bayer
On Jan 27, 2011, at 8:06 PM, Eric N wrote: I'm trying to construct a query where in the from clause I would end up with something like SELECT foo FROM table1 JOIN table2 ON table1.id1 = table2.id1 JOIN table3 ON table1.id1=table3.id1 JOIN table4 ON

Re: [sqlalchemy] datetime interval to a number..

2011-01-27 Thread Petra Clementson
haha you guys make it so easy for us and yet we still can't get. Thanks so much for your help! I think that'll do me just fine. On Thu, Jan 27, 2011 at 3:57 PM, Michael Bayer mike...@zzzcomputing.comwrote: you can emit that exact SQL using func.abs() in conjunction with the extract()

[sqlalchemy] Re: UserDefinedType for tuples

2011-01-27 Thread Enrico
Hi Folks, I was hoping to still be able to get guidance on creating my UserDefinedType. If I just knew exactly what the purpose of the bind and result processes were supposed to be, I'm sure I could look it up from there. -- You received this message because you are subscribed to the Google

Re: [sqlalchemy] Re: UserDefinedType for tuples

2011-01-27 Thread Michael Bayer
Assuming you're using types that are provided by the database (i.e. VARCHAR, ARRAY, INTEGER, etc.), you use a TypeDecorator to add some kind of in-Python marshalling behavior to some Python type. On Jan 28, 2011, at 12:14 AM, Enrico wrote: Hi Folks, I was hoping to still be able to get