title: How to query all rows of a table
body: <p>I'm using Python Sqlalchemy for MYSQL db. I wrote the following script to create the class object and then added some rows in the table.</p>
  
  <pre><code>from sqlalchemy import create_engine, MetaData, Table, Column, ForeignKey
  from sqlalchemy.dialects.mysql.base import VARCHAR, LONGTEXT, INTEGER
  from sqlalchemy.orm import sessionmaker
  from sqlalchemy.ext.declarative import declarative_base
  
  engine = create_engine("mysql+mysqldb://root:@localhost/mydb")
  connection = engine.connect()
  
  Session = sessionmaker(bind=engine)
  session = Session()
  Base = declarative_base()
  metadata = MetaData()
  
  class User(Base):
      __tablename__ = 'User'
      id = Column('id', INTEGER(display_width=11), primary_key=True, nullable=False)
      email = Column('email', VARCHAR(charset='utf8mb4', collation='utf8mb4_0900_ai_ci', length=100), unique=True)
      password = Column('password', VARCHAR(charset='utf8mb4', collation='utf8mb4_0900_ai_ci', length=45))
      name = Column('name', VARCHAR(charset='utf8mb4', collation='utf8mb4_0900_ai_ci', length=100))
  </code></pre>
  
  <p>Now, I need to get all the rows from the table "User" so I am doing this:</p>
  
  <pre><code>user = session.query(User).all()
  print(user)
  </code></pre>
  
  <p>but the output I am getting is not the table data but this:</p>
  
  <pre><code>[&lt;__main__.User object at 0x7f10b0c6ebe0&gt;, &lt;__main__.User object at 0x7f10b0c6ec50&gt;]
  </code></pre>
  
  <p>How would I get the actual data from the table? Any help would be appreciated</p>