Assuming you're in the ORM, there's also a per-instance delete :

http://docs.sqlalchemy.org/en/rel_0_8/orm/events.html#sqlalchemy.orm.events.MapperEvents.after_delete

but `session.query().delete()` suggests you don't want to load objects into 
the ORM, and just want to delete things matching a query. i could be wrong 
-- i've only done `session.delete()` with the ORM.  

if that's the case though, oracle and postgres have a `RETURNING` argument 
to `DELETE` ( mysql and others do not )

it's supported in sqlalchemy's postgres and oracle dialects:

  
 
http://docs.sqlalchemy.org/en/latest/dialects/postgresql.html#insert-update-returning
  
 http://docs.sqlalchemy.org/en/latest/dialects/oracle.html#returning-support

if you're on mysql, I think you'd need to do separate SELECT and DELETE 
statements.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to