How to set connection timeout in SQLAlchemy

后端 未结 7 793
暗喜
暗喜 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:16

    For sqlite backend:

    create_engine(db_url, connect_args={'connect_timeout': timeout})
    

    will set the connection timeout to timeout.

提交回复
热议问题