Expire and refresh the attributes on the given instance. A query will be issued to the database and all attributes will be refreshed with their current database value. This is the async version of the :meth:`_orm.Session.refresh` method. See that method for a comple
(
self,
instance: object,
attribute_names: Optional[Iterable[str]] = None,
with_for_update: ForUpdateParameter = None,
)
| 312 | ) |
| 313 | |
| 314 | async def refresh( |
| 315 | self, |
| 316 | instance: object, |
| 317 | attribute_names: Optional[Iterable[str]] = None, |
| 318 | with_for_update: ForUpdateParameter = None, |
| 319 | ) -> None: |
| 320 | """Expire and refresh the attributes on the given instance. |
| 321 | |
| 322 | A query will be issued to the database and all attributes will be |
| 323 | refreshed with their current database value. |
| 324 | |
| 325 | This is the async version of the :meth:`_orm.Session.refresh` method. |
| 326 | See that method for a complete description of all options. |
| 327 | |
| 328 | .. seealso:: |
| 329 | |
| 330 | :meth:`_orm.Session.refresh` - main documentation for refresh |
| 331 | |
| 332 | """ |
| 333 | |
| 334 | await greenlet_spawn( |
| 335 | self.sync_session.refresh, |
| 336 | instance, |
| 337 | attribute_names=attribute_names, |
| 338 | with_for_update=with_for_update, |
| 339 | ) |
| 340 | |
| 341 | async def run_sync( |
| 342 | self, |