app.config['SQLALCHEMY_DATABASE_URI'] = "mysql://root:xxx@127.0.0.1/xxx"app.config["SQLALCHEMY_BINDS"]={ "sqlite_test":"sqlite:///database.db"}配置如上?我有一個需求是執(zhí)行db.session.execute("select xxxx")這個execute方法默認會在mysql中查找。
1 回答

溫溫醬
TA貢獻1752條經驗 獲得超4個贊
找到答案了。
db.session.execute("select xxx",bind=db.get_engine(current_app,bind="sqlite_test")).fetchall()
- 1 回答
- 0 關注
- 200 瀏覽
添加回答
舉報
0/150
提交
取消