Set statement timeout for query execution
How to set statement timeout for query execution? Prerequisites: sqlalchemy 1.3.19 MySQL 5.7.13 You can set the connection timeout easily like this:
1 2 |
sqlalchemy.create_engine("mysql+pymysql://{}:{}@{}:{}/{}?charset={}", connect_args={'connect_timeout': 10}) //10 seconds |