🎨 Refresh Objects Explicitly

This commit is contained in:
洛水居室 2023-03-15 12:21:53 +08:00
parent 80dc9f4e2a
commit c5d3e6a9c1
No known key found for this signature in database
GPG Key ID: C9DE87DA724B88FC

View File

@ -41,6 +41,7 @@ class PlayersRepository(BaseService.Component):
async with AsyncSession(self.engine) as session: async with AsyncSession(self.engine) as session:
session.add(player) session.add(player)
await session.commit() await session.commit()
await session.refresh(player)
async def delete(self, player: Player) -> None: async def delete(self, player: Player) -> None:
async with AsyncSession(self.engine) as session: async with AsyncSession(self.engine) as session: