【转】SQLAlchemy打印SQL语句

原文地址:http://heipark.iteye.com/blog/1847635

 

SQLAlchemy打开SQL语句方法如下,echo=true将开启该功能:

 

engine = create_engine("<db_rul>", echo=True)

 

Flask-SQLAlchemy打开SQL方法如下:

 

app.config["SQLALCHEMY_ECHO"] = True

 

猜你喜欢

转载自luchuan.iteye.com/blog/2247433