apparently engine.begin() does not need to be awaited
This commit is contained in:
parent
7478c8e404
commit
6846c763f2
2 changed files with 4 additions and 3 deletions
|
|
@ -33,7 +33,7 @@ from .strtools import PrefixIdentifier
|
|||
from .validators import matches
|
||||
from .redact import redact_url_password
|
||||
|
||||
__version__ = "0.5.0-dev30"
|
||||
__version__ = "0.5.0-dev31"
|
||||
|
||||
__all__ = (
|
||||
'ConfigOptions', 'ConfigParserConfigSource', 'ConfigSource', 'ConfigValue',
|
||||
|
|
|
|||
|
|
@ -41,8 +41,9 @@ class SQLAlchemy:
|
|||
async def begin(self) -> AsyncSession:
|
||||
if self.engine is None:
|
||||
raise RuntimeError('database is not connected')
|
||||
return await self.engine.begin()
|
||||
__aenter__ = begin
|
||||
return self.engine.begin()
|
||||
async def __aenter__(self):
|
||||
return self.begin()
|
||||
async def __aexit__(self, e1, e2, e3):
|
||||
return await self.engine.__aexit__(e1, e2, e3)
|
||||
async def paginate(self, select: Select, *,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue