amisadmin / fastapi-amis-admin

FastAPI-Amis-Admin is a high-performance, efficient and easily extensible FastAPI admin framework. Inspired by django-admin, and has as many powerful functions as django-admin.

Home Page:http://docs.amis.work

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'AsyncAdapt_asyncpg_cursor' object has no attribute 'lastrowid'

dongfengweixiao opened this issue · comments

commented

使用 postgresql+asyncpg 时,当插入数据时,能够正常写入数据库,但是客户端会提示内部错误,终端提示没有 lastrowid 的问题。
YB0R2~7ZXG){`) H T6G8Y8
AttributeError: 'AsyncAdapt_asyncpg_cursor' object has no attribute 'lastrowid'

如需更多有效信息,请告知

  • postgresql不支持插入的时候获取lastrowid, 版本v0.0.21已将此属性默认值None.
  • sqlalchemy有一个inserted_primary_key属性, 但是我尝试没有成功, 如果需要插入数据的时候返回id,你可以研究一下这个属性的用法,提供更好的解决方案.
commented

版本v0.0.21已修复.