title: Column-name mapping in SQLAlchemy
body: <p>I'm just two days into learning SQLAlchemy, and have a question regarding mapping of column names. First off, the following statement in the official docs threw me off balance:</p>
  
  <blockquote>
    <p>Matching columns on name works for simple cases but can become
    unwieldy when dealing with complex statements that contain duplicate
    column names or when using anonymized ORM constructs that don’t easily
    match to specific names. Additionally, there is typing behavior
    present in our mapped columns that we might find necessary when
    handling result rows.</p>
  </blockquote>
  
  <p>Ugh, what?! An example or two of what this paragraph is trying to say would have been great, but never mind; it's a task for another day.</p>
  
  <p>I kind of understood that sometimes the field list generated by our query will not map perfectly with the model, so we can specify expected columns positionally. This got me trying to think up an example where this mapping might be useful. So I thought, how about selecting a column from the table that is calculated on the fly? I simulated this in a <code>sqlite</code> database using the <code>random()</code> function like this:</p>
  
  <pre><code>from sqlalchemy import create_engine
  from sqlalchemy.ext.declarative import declarative_base
  from sqlalchemy import Column, Integer, String
  from sqlalchemy.orm import sessionmaker
  
  engine = create_engine('sqlite:///:memory:', echo=True)
  Base = declarative_base()
  
  Session = sessionmaker(bind=engine)
  session = Session()
  
  class User(Base):
      __tablename__ = 'users'
      id       = Column(Integer, primary_key=True)
      name     = Column(String)
      fullname = Column(String)
      password = Column(String)
  
      def __repr__(self):
          return "User&lt;name={}, fullname={}, password={}&gt;".format(self.name, self.fullname, self.password)
  
  # Create all tables
  Base.metadata.create_all(engine)
  
  ed_user = User(name='ed', fullname='Ed Jones', password='edspassword')
  session.add(ed_user)
  session.add_all([
      User(name='wendy', fullname='Wendy Williams', password='foobar'),
      User(name='mary', fullname='Mary Contrary', password='xxg527'),
      User(name='fred', fullname='Fred Flinstone', password='blah')
  ])
  session.commit()
  
  stmt = text("SELECT name, id, fullname, random() FROM users WHERE name=:name")
  stmt = stmt.columns(User.name, User.id, User.fullname ...
  </code></pre>
  
  <p>Now what? I can't write a column name because none exists, and I can't add it to the model definition because this column will be created unnecessarily. All I wanted to get some extra information from the database (like <code>NOW()</code>) that I can use in code.</p>
  
  <p>How can this be done?</p>