diff --git a/src/suou/__init__.py b/src/suou/__init__.py index 9108eac..ceeb709 100644 --- a/src/suou/__init__.py +++ b/src/suou/__init__.py @@ -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', diff --git a/src/suou/sqlalchemy_async.py b/src/suou/sqlalchemy_async.py index cd082b8..42045fc 100644 --- a/src/suou/sqlalchemy_async.py +++ b/src/suou/sqlalchemy_async.py @@ -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, *,