title: SQLAlchemy ORM: "AttributeError: Could not locate column in row"
body: <p>I'm learning SQLAlchemy right now, but I've encountered an error that puzzles me. Yes, there are similar questions here on SO already, but none of them seem to be solved.</p>
  <p>My goal is to use the ORM mode to query the database. So I create a model:</p>
  <pre class="lang-py prettyprint-override"><code>from sqlalchemy import Column, Integer, String, create_engine
  from sqlalchemy.orm import Session, registry
  from sqlalchemy.sql import select
  
  database_url = &quot;mysql+pymysql://...&quot;
  
  mapper_registry = registry()
  Base = mapper_registry.generate_base()
  
  
  class User(Base):
      __tablename__ = &quot;user&quot;
  
      id = Column(Integer, primary_key=True)
      name = Column(String(32))
  
  
  engine = create_engine(database_url, echo=True)
  mapper_registry.metadata.create_all(engine)
  </code></pre>
  <p>New I want to load the whole row for all entries in the table:</p>
  <pre class="lang-py prettyprint-override"><code>with Session(engine) as session:
      for row in session.execute(select(User)):
          print(row.name)
  
  #- Error: #
  
  Traceback (most recent call last):
  ...
      print(row.name)
  AttributeError: Could not locate column in row for column 'name'
  </code></pre>
  <p>What am I doing wrong here? Shouldn't I be able to access the fields of the ORM model? Or am I misunderstanding the idea of ORM?</p>
  <p>I'm using Python 3.8 with PyMySQL 1.0.2 and SQLAlchemy 1.4.15 and the server runs MariaDB.</p>
  <p>This is example is as minimal as I could make it, I hope anyone can point me in the right direction. Interestingly, inserting new rows works like a charm.</p>