1

I created a table using join()

q = db_session.query(Email).join(Candidate)

Is there a way to print out either the contents of q or the columns?

Morgan Allen
  • 3,291
  • 8
  • 62
  • 86

1 Answers1

1

Sure, .join() produces a new Query object which you can inspect via .column_descriptions and .statement:

print(q.column_descriptions)
print(q.statement)

There is more to how you can inspect the query, please see:

Community
  • 1
  • 1
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195