title: Sqlalchemy RETURNING scalar
body: <p>i was messing around with the sqlalchemy return clause, consider the following code</p>
  <pre><code>stmt = insert(A).values({&quot;data&quot;: &quot;data&quot;, &quot;id&quot;:2}).returning(A)
  result = await session.execute(stmt)
  print(type(result.scalar()))
  </code></pre>
  <p>the output just prints a integer</p>
  <p>but if I use a <code>select</code> statement instead of return it gives the mapped row object?</p>
  <pre><code>stmt = select(A).where(A.id == 2)
  result = await session.execute(stmt)
  print(type(result.scalar()))
  </code></pre>
  <p>why does this happen?</p>