title: sqlalchemy - how can I get update method result?
body: <p>I execute <code>update</code> method:</p>
  
  <pre><code># connect db to get `conn`
  # get metadate which is table `account`
  u = account.update().where(account.c.ID == 9).values(USERNAME='k9')
  r = conn.execute(u)
  </code></pre>
  
  <p>How can I get the <code>update</code> is success or not?
  I checked the doc, but not found...</p>
  
  <p>Or maybe I just do not care this??</p>
  
  <p><code>r</code> is a <code>ResultProxy</code>, <code>update</code> action do auto-commit and close.</p>
  
  <p>THX:)</p>
  
  <hr>
  
  <p>APPEND</p>
  
  <p>THX @Lucas Kahlert's answer, good point!</p>
  
  <p><code>rowcount</code> satisfy my question's situation.</p>
  
  <p><a href="http://docs.sqlalchemy.org/en/rel_0_9/core/connections.html#sqlalchemy.engine.ResultProxy.rowcount" rel="nofollow">doc-rowcount</a></p>
  
  <pre><code>This attribute returns the number of rows matched, 
  which is not necessarily the same as the number of rows that were actually modified
  
  In [7]: u = account.update().\
          where( and_((account.c.ID == 4), (account.c.PWD =='4297f44b1'))).\
          values(PWD='hahahaha')
  
  In [8]: print u
  UPDATE `ACCOUNT` SET `PWD`=%s WHERE `ACCOUNT`.`ID` = %s AND `ACCOUNT`.`PWD` = %s
  
  In [11]: rst = conn.execute(u)
  
  In [12]: rst.rowcount  # found row and did update action
  Out[12]: 1L
  
  In [13]: rst = conn.execute(u)
  
  In [14]: rst.rowcount  # found row but value is same, so do not do update action
  Out[14]: 0L
  </code></pre>