[sqlalchemy] Find out what's going to be deleted

2013-06-02 Thread public
When using more complex, hierarchical models with differing settings on how cascade deletes are handled it gets quite hard to figure out beforehand what a delete() will exactly do with the database. I couldn't find any way to get this piece of information (Hey SQLAlchemy, what will be deleted if

Re: [sqlalchemy] Find out what's going to be deleted

2013-06-02 Thread Michael Bayer
The only deletes that aren't present in session.deleted before the flush are those that will occur because a particular object is an orphan, and the objects which would be deleted as a result of a cascade on that orphan. So without orphans taken into account, session.deleted tells you

Re: [sqlalchemy] Find out what's going to be deleted

2013-06-02 Thread Michael Bayer
I guess the big question is, when are you calling this. An easy system would be to add a new event flush_plan_complete which will put you into a flush() right as the full plan has been assembled, but before any SQL occurs. It could allow you to register more objects for activity, and it

Re: [sqlalchemy] Find out what's going to be deleted

2013-06-02 Thread public
Thanks a lot for your comprehensive answer! I was able to solve my problem by implementing your first suggestion. Orphans do not play a role yet… I think :-) On 06/02/2013 05:09 PM, Michael Bayer wrote: The only deletes that aren't present in session.deleted before the flush are those that

[sqlalchemy] 0.8 doc url goes to 0.9 docs

2013-06-02 Thread Jon Rosebaugh
The url I've been using for the 0.8 docs (http://docs.sqlalchemy.org/en/rel_0_8/) now goes to a page listing 0.9 docs. There doesn't seem to be any way to get at 0.8's docs from the website. -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To

Re: [sqlalchemy] Query and compiled_cache

2013-06-02 Thread Claudio Freire
On Sat, Jun 1, 2013 at 10:59 PM, Michael Bayer mike...@zzzcomputing.comwrote: The recipe on the wiki also has the issue that it isn't even caching anything to do with the QueryContext, including all of this information regarding eager joins which is pretty important. Your modifications try to

Re: [sqlalchemy] 0.8 doc url goes to 0.9 docs

2013-06-02 Thread Michael Bayer
I cant even tell what the issue is, the rel_0_8 tag is correct in git and readthedocs is supposed to be building that tag. But its checking out master. I'm not sure how to fix this at the moment. On Jun 2, 2013, at 8:34 PM, Jon Rosebaugh chai...@gmail.com wrote: The url I've been using

Re: [sqlalchemy] 0.8 doc url goes to 0.9 docs

2013-06-02 Thread Jon Rosebaugh
https://sqlalchemy.readthedocs.org/en/rel_0_8/ actually does seem to have the correct stuff too. On Sunday, June 2, 2013 5:43:34 PM UTC-7, Michael Bayer wrote: I cant even tell what the issue is, the rel_0_8 tag is correct in git and readthedocs is supposed to be building that tag. But its

Re: [sqlalchemy] 0.8 doc url goes to 0.9 docs

2013-06-02 Thread Michael Bayer
They wiped everything and it should work now. Sent from my iPhone On Jun 3, 2013, at 12:19 AM, Jon Rosebaugh chai...@gmail.com wrote: https://sqlalchemy.readthedocs.org/en/rel_0_8/ actually does seem to have the correct stuff too. On Sunday, June 2, 2013 5:43:34 PM UTC-7, Michael Bayer

Re: [sqlalchemy] Query and compiled_cache

2013-06-02 Thread Michael Bayer
Well, if that works, it certainly covers my needs so there would be no pressing need to incorporate it into the core. I'll let you know tomorrow. It's so straightforward at this point I'm leaning towards some more cleanup and adding to 0.9. I'll probably cache the compiled statements

Re: [sqlalchemy] Query and compiled_cache

2013-06-02 Thread Claudio Freire
On Mon, Jun 3, 2013 at 1:55 AM, Michael Bayer mike...@zzzcomputing.comwrote: Well, if that works, it certainly covers my needs so there would be no pressing need to incorporate it into the core. I'll let you know tomorrow. It's so straightforward at this point I'm leaning towards some more