我正在尝试异步运行
engine = create_engine('sqlite:///./test.db')
stmt = session.query(MyTable)
data = pd.read_sql(stmt, engine)
但它失败,错误为AttributeError: 'AsyncConnection' object has no attribute 'cursor'
。
什么才是让这件事成功的正确方法?
asyn_engine = create_async_engine('sqlite+aiosqlite:///./test.db')
stmt = select(MyTable)
data = pd.read_sql(stmt, async_engine)
1条答案
按热度按时间to94eoyn1#
原则上,这个代码是有效的……