I'm not asking abount how to execute a raw sql string with sqlalchemy. I want to build sqlalchemy.orm.query.Query object which also can be built by code like below.
query = s.query(User).filter(User.age<10)
I tried something like
query = s.query('* from User where age<10')
It seems to work properly in some cases, but it's actual behavior is quite different from what I expected. For example, query.column_descriptions return wrong values. Speaking differently, I'm looking for a function which parses a sql string and returns a Query object which can be used to inspect the details. I expect there exists a simple way to do it. Does anyone know about this ?