我正在尝试做相当于
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)