I have 2 queries which both get a subset of a tables, let's call them Table1
and Table2
I would like to join these 2 child tables on their id
.
I tried something like this, but it throws unhelpful errors:
table1: List[Table1] = db.session.execute(query1)
table2: List[Table2] = db.session.execute(query2)
db.session.query(table1).join(table2, table1.id == table2.id).all()