Hello Mike!
First of all, thank you for your help with this 
<https://groups.google.com/forum/#!topic/sqlalchemy/URbnrqZl-O0> problem. 
Me and my crew appreciate it.


I have a question in case of `identity_token` for `update` and `delete` 
methods of `Query` instances.

If we take a look on sqlalchemy.orm.persistence.BulkDelete._do_exec, we 
see, that there is no additonal kwargs passed to `execute` method. So I 
don't see any way to pass additional kwargs to Session.get_bind. Here is 
code of 1.0 version:

def _do_exec(self):
    delete_stmt = sql.delete(self.primary_table,
                             self.context.whereclause)

    self.result = self.query.session.execute(
        delete_stmt,
        params=self.query._params,
        mapper=self.mapper,
        # need to pass here additional kwargs
)
    self.rowcount = self.result.rowcount

Code from master branch (almost the same):

    def _execute_stmt(self, stmt):
        self.result = self.query.session.execute(
            stmt, params=self.query._params,
            mapper=self.mapper)
        self.rowcount = self.result.rowcount




As you may remember, I have some kind of `CustomQuery` with `set_bind` 
method (like the same into sqlalchemy.ext.horizontal_shard.ShardedQuery). 
So I have `_bind_id` attribute within instances of that class.
My question is: Is there any way to pass `self.query._bind_id` to 
`self.query.session.execute` (see above)?

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to