Re: [sqlalchemy] Dynamic model creation for temporary table

2013-09-25 Thread Aleksandr Kuznetsov
Thanks for the answer! silly question, is there a reason standard replication techniques provided by the database can't be used here? they might be a little more heavy-handed to set up than some in-app trick but it'll work more solidly. Yes, there is a reason: there are no any standard

[sqlalchemy] [SA0.7] Possible feature request for subqueryload?

2013-09-25 Thread Ladislav Lenart
Hello. Would it be possible to make these two forms session.query(cls).options( subqueryload(cls.foos), subqueryload(cls.foos, Foo.bar), ) and session.query(cls).options( subqueryload_all(cls.foos, Foo.bar) ) completely equivalent, i.e. subqueryload_all

Re: [sqlalchemy] [SA0.7] Possible feature request for subqueryload?

2013-09-25 Thread Michael Bayer
On Sep 25, 2013, at 10:11 AM, Ladislav Lenart lenart...@volny.cz wrote: Hello. Would it be possible to make these two forms session.query(cls).options( subqueryload(cls.foos), subqueryload(cls.foos, Foo.bar), ) and session.query(cls).options(

Re: [sqlalchemy] Dynamic model creation for temporary table

2013-09-25 Thread Michael Bayer
On Sep 25, 2013, at 2:15 AM, Aleksandr Kuznetsov aku.ru...@gmail.com wrote: The rotation of tables is not a problem. Of course I can do it by constructing simple SQL statement. I just want to simplify life for a client (client is an app for collecting data) - I want it should pass to me

[sqlalchemy] How to not losing changes on rollback?

2013-09-25 Thread Julio César Gázquez
Hi. I'd like to know what's the recommended approach to keep the state of the session and the associated objects when session.flush() fails, in order to being able to fix the cause of the problem and retry the operation. For cases with a single object hierarchy, I think using session.merge()

[sqlalchemy] Re: How to not losing changes on rollback?

2013-09-25 Thread Jonathan Vanasco
I'd be interested in this too. FWIW, my approach is this: - flush often - encapsulate complex logic in 'savepoints' , roll back to them - fail everything and start from scratch on other errors -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To

Re: [sqlalchemy] How to not losing changes on rollback?

2013-09-25 Thread Michael Bayer
On Sep 25, 2013, at 12:23 PM, Julio César Gázquez julio_li...@mebamutual.com.ar wrote: Hi. I'd like to know what's the recommended approach to keep the state of the session and the associated objects when session.flush() fails, in order to being able to fix the cause of the problem and

[sqlalchemy] timing / profiling object loading ?

2013-09-25 Thread Jonathan Vanasco
is there a way to time the time spent 'loading' an object from the database ? i think there might be a bottleneck in a part of my application that is related to the object instantiation. just to be clear , in this flow: a) `query.all()` b) sqlalchemy compiles query c) sqlalchemy to db

Re: [sqlalchemy] timing / profiling object loading ?

2013-09-25 Thread Michael Bayer
I tend to use standard python profiling for that http://stackoverflow.com/questions/1171166/how-can-i-profile-a-sqlalchemy-powered-application/1175677#1175677 On Sep 25, 2013, at 4:44 PM, Jonathan Vanasco jonat...@findmeon.com wrote: is there a way to time the time spent 'loading' an object

Re: [sqlalchemy] timing / profiling object loading ?

2013-09-25 Thread Jonathan Vanasco
very good. thanks. i accidentally left a LIMIT off a query. The DB was optimized to return the results in about .003s ; but it seems to have taken about 2 minutes for sqlalchemy to generate ~1300 objects from the rows. -- You received this message because you are subscribed to the Google

Re: [sqlalchemy] timing / profiling object loading ?

2013-09-25 Thread Michael Bayer
that seems *very* slow? On Sep 25, 2013, at 5:05 PM, Jonathan Vanasco jonat...@findmeon.com wrote: very good. thanks. i accidentally left a LIMIT off a query. The DB was optimized to return the results in about .003s ; but it seems to have taken about 2 minutes for sqlalchemy to

[sqlalchemy] finding sqlalchemy jobs?

2013-09-25 Thread Iain Duncan
Hi folks, apologies for sounding spammy. I'm wondering if anyone has suggestions on how to find remote work doing SQLAlchemy stuff, been wanting to leave the uncertain world of freelancing and do some actual coding for a while. I found some posts tagging SQLAlchemy on Stack Overflow Careers, but

Re: [sqlalchemy] Re: Duplicating primary key value into another column upon insert?

2013-09-25 Thread Ken Lareau
On Tue, Sep 24, 2013 at 5:40 PM, Nicholas Long nick.studioc...@gmail.comwrote: My mind keeps going back to events but of course there's the limitation to modifying Session state while handling various events. (