Re: [sqlalchemy] Issue with transactions and proxied db_api queries

2011-12-12 Thread Noon Silk
On Tue, Dec 13, 2011 at 3:44 PM, Michael Bayer wrote: > On Dec 12, 2011, at 7:10 PM, Noon Silk wrote: >> On Tue, Dec 13, 2011 at 9:19 AM, Michael Bayer >> wrote: >>> On Dec 12, 2011, at 5:08 PM, Noon Silk wrote: Hello, Firstly I'd like to explain what I'm trying to do, and that is

Re: [sqlalchemy] Issue with transactions and proxied db_api queries

2011-12-12 Thread Michael Bayer
On Dec 12, 2011, at 7:10 PM, Noon Silk wrote: > On Tue, Dec 13, 2011 at 9:19 AM, Michael Bayer > wrote: >> On Dec 12, 2011, at 5:08 PM, Noon Silk wrote: >>> Hello, >>> >>> Firstly I'd like to explain what I'm trying to do, and that is: Use >>> SQLAlchemy alongside regular cursor style queries.

Re: [sqlalchemy] Issue with transactions and proxied db_api queries

2011-12-12 Thread Noon Silk
On Tue, Dec 13, 2011 at 9:19 AM, Michael Bayer wrote: > On Dec 12, 2011, at 5:08 PM, Noon Silk wrote: >> Hello, >> >> Firstly I'd like to explain what I'm trying to do, and that is: Use >> SQLAlchemy alongside regular cursor style queries. More specifically, >> I want to use SQLAlchemy in my unit

Re: [sqlalchemy] Issue with transactions and proxied db_api queries

2011-12-12 Thread Michael Bayer
On Dec 12, 2011, at 5:08 PM, Noon Silk wrote: > Hello, > > Firstly I'd like to explain what I'm trying to do, and that is: Use > SQLAlchemy alongside regular cursor style queries. More specifically, > I want to use SQLAlchemy in my unit tests, and importanyl, I want to > wrap all test operations

Re: [sqlalchemy] ORM API and cursor

2011-12-12 Thread Michael Bayer
On Dec 12, 2011, at 3:54 PM, S2w wrote: > Hi, > I failed to find the answer to this one... (sounds like an FAQ > though). > > I like the ORM API but I need to deal with relatively big tables > (between 1 and 10 million rows each containing up to 500kb) and I want > to avoid the overhead of "offs

Re: [sqlalchemy] Many-to-Many best practice

2011-12-12 Thread Michael Bayer
On Dec 12, 2011, at 11:38 AM, John Hufnagle wrote: > I am developing a REST web service with a Parent, Child many-to-many > relationship. > > If I have an existing Parent with a relationship collection of Child > objects and as an example: > > Existing Parent 1 has children associations Child 1

[sqlalchemy] Issue with transactions and proxied db_api queries

2011-12-12 Thread Noon Silk
Hello, Firstly I'd like to explain what I'm trying to do, and that is: Use SQLAlchemy alongside regular cursor style queries. More specifically, I want to use SQLAlchemy in my unit tests, and importanyl, I want to wrap all test operations in transaction, and have the SQLAlchemy operations and db_

[sqlalchemy] ORM API and cursor

2011-12-12 Thread S2w
Hi, I failed to find the answer to this one... (sounds like an FAQ though). I like the ORM API but I need to deal with relatively big tables (between 1 and 10 million rows each containing up to 500kb) and I want to avoid the overhead of "offset" with Postgresql (that, from what I read, puts some s

[sqlalchemy] Many-to-Many best practice

2011-12-12 Thread John Hufnagle
I am developing a REST web service with a Parent, Child many-to-many relationship. If I have an existing Parent with a relationship collection of Child objects and as an example: Existing Parent 1 has children associations Child 1 (id=1), Child 2(id=2) And I receive an Update call to the web ser

Re: [sqlalchemy] quasi-run time ForeignKey definition

2011-12-12 Thread Michael Bayer
On Dec 11, 2011, at 8:52 PM, Viktor Nagy wrote: > hi, > > I would like to build a reusabe forum application. For the sake of simplicity > we need two tables Owner and Thread. There is a ForeignKey from Thread to > Owner. As reusability goes, the Owner table is given in a configuration > argum

Re: [sqlalchemy] how add comment before query statement?

2011-12-12 Thread Michael Bayer
we have select.prefix_with() which can stick it right after the SELECT, if that worksotherwise if it really has to be the first thing would need to work in some @compiles tricks. then as far as Query I thought we had added something for this but apparently not, you'd have to subclass th

[sqlalchemy] how add comment before query statement?

2011-12-12 Thread lestat
For our postgresql cluster we need sometime append comment before query statement. E.g. q = Comment.query.all() SELECT ... FROM comment How append comment like this? /*NO LOAD BALANCE*/ SELECT ... FROM comment I try change q.statement, but can't find right solution. Thanks! -- You received