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