Suppose if I have a SQLAlchemy table as follows -
class Employee(Base):
id = Column(Integer, primary_key=True)
employee_desgination = Column(String)
I remember going through the docs once and seeing some way of using aliases for long column names and use shorter ones instead. For example, in the above table instead of calling Employee.employee_designation
I'd like to use Employee.emp_d
or something similar. I wasn't able to find the example again :/ I think you declare an alias()
in the table definition, but I am not sure of the syntax.