Async context manager entry - connect to a database.
(self)
| 171 | _transaction_connection.set(conn) |
| 172 | |
| 173 | async def __aenter__(self) -> "DatabaseConnection": |
| 174 | """Async context manager entry - connect to a database.""" |
| 175 | await self.connect() |
| 176 | return self |
| 177 | |
| 178 | async def __aexit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None: |
| 179 | """Async context manager exit - disconnect from database.""" |