How to use RETURNING for query.update() with sqlalchemy : <p>I want to specify the return values for a specific update in sqlalchemy.</p>

<p>The documentation of the underlying <a href="http://docs.sqlalchemy.org/en/latest/core/dml.html#sqlalchemy.sql.expression.update" rel="noreferrer">update statement</a> (sqlalchemy.sql.expression.update) says it accepts a "returning" argument and the docs for the <a href="http://docs.sqlalchemy.org/en/latest/orm/query.html#sqlalchemy.orm.query.Query" rel="noreferrer">query object</a> state that query.update() accepts a dictionary "update_args" which will be passed as the arguments to the query statement.</p>

<p>Therefore my code looks like this:</p>

<pre><code>session.query(
  ItemClass
).update(
  {ItemClass.value: value_a},
  synchronize_session='fetch',
  update_args={
    'returning': (ItemClass.id,)
  }
)
</code></pre>

<p>However, this does not seem to work. It just returns the regular integer.</p>

<p>My question is now: Am I doing something wrong or is this simply not possible with a query object and I need to manually construct statements or write raw sql?</p>
