I have recently started using SQLALCHEMY to query a my-sql database. I want to generate a select statement that uses the “INTO OUTFILE <file>” syntax to export query results to a test file. For example:
SELECT *
FROM table
INTO OUTFILE '/tmp/export.txt';
Is there a way to generate the “INTO OUTFILE...” clause using SQLALCHEMY?
If not, can I subclass one of the SQLALCHEMY classes so I can build that clause myself?
Thanks.
I did some thinking and poking around the examples on the SQLAlchemy site and figured it out. (Also posted to sql-alchemy user reciptes)