How Pony (ORM) does its tricks?
Pony ORM author is here. Pony translates Python generator into SQL query in three steps: Decompiling of generator bytecode and rebuilding generator AST (abstract syntax tree) Translation of Python AST into “abstract SQL” — universal list-based representation of a SQL query Converting abstract SQL representation into specific database-dependent SQL dialect The most complex part is … Read more