I'm using sqlalchemy in a flask application that connects to multiple databases, using binds as shown here. I want to execute a raw sql query on one of the non-primary databases.
I'm trying to use session.execute, as shown here but it executes for the primary db. The API docs state that you can use a parameter: "bind – Optional Engine to be used as the bind". How do I access and specify the bind for the non-primary db and call session.execute to execute a query for that db?
Alternately, is there any other way to go about it?