In this example:
with db_session:
p = select(_ for _ in Person in _.name == 'John')[:][0]
I need this for debugging purposes, since I would like to see the SQL it generates to a similar query in other ORMs.
One can use pony.orm.sql_debug(True)
. This will show you all the SQL that pony generates whenever one is in a transaction. Debugging SQL in Pony