i'm using fastapi + sqlalchemy with a sqlite db.
When i'm deleting records they are not deleted.
When i check sqlalchemy.py code i have the following:
async def orm_delete_obj(self, id: UUID | int) -> None:
"""This method is used to delete orm/db model object.
:params id: an id of object.
:return: None.
"""
sessionmaker = self.get_sessionmaker()
async with sessionmaker() as session:
obj = await session.get(self.model_cls, id)
await session.delete(obj)
i think you shoud add
await session.commit()
like in orm_save_obj method
Hello,
i'm using fastapi + sqlalchemy with a sqlite db. When i'm deleting records they are not deleted.
When i check sqlalchemy.py code i have the following:
i think you shoud add
await session.commit()
like in orm_save_obj method