How to set connection timeout in SQLAlchemy

后端 未结 7 792
暗喜
暗喜 2020-12-14 16:00

I\'m trying to figure out how to set the connection timeout in create_engine(), so far I\'ve tried:

create_engine(url, timeout=10)
7条回答
  •  無奈伤痛
    2020-12-14 16:22

    for SQL Server use the Remote Query Timeout:

    create_engine(db_url, connect_args={'Remote Query Timeout': 10})
    

    default is 5 seconds.

提交回复
热议问题