now Db works like it did

This commit is contained in:
AF 2022-11-01 03:36:43 +00:00 committed by parrrate
parent 78a29c188d
commit ac2fe36f6e
Signed by: alisa
SSH Key Fingerprint: SHA256:vNY4pdIZvO1FYJKHROkdHLtvyopizvZVAEwg9AF6h04

View File

@ -301,3 +301,10 @@ class Db(DbFactory, DbConnection):
def __init__(self, path: str | pathlib.Path, *, kvrequest_type: Type[KVRequest], buffersize=1048576):
DbFactory.__init__(self, path, kvrequest_type=kvrequest_type, buffersize=buffersize)
DbConnection.__init__(self, self)
async def __aenter__(self):
await self._initialize()
return self
async def __aexit__(self, exc_type, exc_val, exc_tb):
await self.aclose()