[Sqlalchemy-tickets] Issue #3242: Delete doesn't use mapper (query does!) (zzzeek/sqlalchemy)
Brought to you by:
zzzeek
|
From: asyschikov <iss...@bi...> - 2014-11-05 19:28:54
|
New issue 3242: Delete doesn't use mapper (query does!) https://bitbucket.org/zzzeek/sqlalchemy/issue/3242/delete-doesnt-use-mapper-query-does asyschikov: Maybe not strictly a bug but it led to very buggy/unexpected results. When query is getting connection it passes a mapper: ``` #!python conn = self._connection_from_session( mapper=self._mapper_zero_or_none(), clause=querycontext.statement, close_with_result=True) ``` But delete (BulkDelete) does not: ``` #!python self.result = self.query.session.execute(delete_stmt, params=self.query._params) ``` We have a table that is not in binds list (session.__binds), so for the same table query works (because of mapper) but delete not and it was very hard to figure out what is the difference. It would be much better if delete used the same mechanism as query. |