I want to select data from the user and account tables. there are id and name column which exists in both tables. so SQLAlchemy applies labels while querying into the database. for e.g
query=(User.name, User.id, Account.name, Account.id).join(Account, Account.user_id = User.id)
print(query)
select user.name as user_name, user.id as user_id, account.name as account_name, account.id as account_id from user, join account on account.user_id = user.id;
when iterating over results each row contains only id and name attribute. so either I can get user name or account name when I will access it
result = session(query).all()
for row in result:
print(row.name, row.id)
I know i can apply label to the column to give alias name but I don't want to manually apply a label to each column.