Im trying to allow users to input query in the UI and then add it to the FROM clause of my sqlalchemy.
After seeing the from_self function on the query object in the docs, I tried:
Query.from_statement(text("select * from test_table")).from_self()
and:
alias(text("select * from test_table"), name="some_name")
and:
text("select * from test_table").label(name="some_name")
None of these worked. Im trying to get a query like this:
(SELECT * FROM test_table) AS some_name