[sqlalchemy] Re: something wrong about sqlsoup in mulithread request

2009-06-09 Thread tsangpo
I finally solved the problem. I used to create a join in each request, where will produce this problem. Now I create the join once and reuse in each request, everything is OK now. And I do use a universal SqlSoup object. - Original Message - From: Michael Bayer mike...@zzzcomputing.com

[sqlalchemy] Re: insert statment

2009-06-09 Thread Michael Bayer
normal SQL includes named bind parameters. you might be looking for a raw execution, i.e.: conn.execute(insert into table (a, b, c) values (?, ?, ?), [(1,2,3), (4,5,6)]) that will take you right through to the DBAPI but your code will not be database agnostic. Ashish Bhatia wrote: yeah

[sqlalchemy] Re: insert statment

2009-06-09 Thread Mike Conley
The insert is looking for a list of dictionaries. What you would like to do is enter column names once along with lists representing rows of data to insert. Here is some code I use to simplify setting up the dictionaries when inserting a large number of rows. I'm sure others have come up with

[sqlalchemy] Re: 0.5.3 ORM, MSSQL and FreeTDS: Invalid Cursor State exception?

2009-06-09 Thread Lukasz Szybalski
On Mon, Jun 8, 2009 at 2:46 PM, ddorothydidoro...@gmail.com wrote: I have looked into this and considered what you have said.  I think I have come up with a potential solution.  It seems to be that the most common driver for mssql on non-windows platforms is going to be freeTDS.  Since there

[sqlalchemy] Re: Formatting return of 'query'

2009-06-09 Thread Mike Conley
There are probably multiple ways to do what you are looking for. I would consider simply constructing the query without the .all() and returning the query instance. Callers then simply iterate over the query themselves. No need to parse a string to get the individual columns; they could do