sqlalchemy 的sqlite多线程设置

前端之家收集整理的这篇文章主要介绍了sqlalchemy 的sqlite多线程设置前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import create_engine
from sqlalchemy import Column,String,Integer
from sqlalchemy.pool import SingletonThreadPool

 

service_engine = create_engine(
sqlite:///{}‘.format(os.path.join(settings.BASE_DIR,‘test.db‘)),
poolclass=SingletonThreadPool,
connect_args={‘check_same_thread‘: False}
)

猜你在找的Sqlite相关文章