1234567891011121314151617181920 |
- from aiosqlite import Connection
- from ..types import Message, Context
- from .base import InjectorWithCleanup
- __all__ = [
- "Database",
- ]
- class DatabaseInjector(InjectorWithCleanup[Connection]):
- async def inject(self, message: Message, context: Context) -> Connection:
- return await context.database()
- async def cleanup(self, conn: Connection):
- await conn.close()
- Database = DatabaseInjector()
- # TODO data store for blob data
|