from __future__ import annotations

from typing import Any

from app.core.mongo_runtime import get_mongo_runtime


class _AsyncDatabaseProxy:
    def __getattr__(self, item: str) -> Any:
        return getattr(get_mongo_runtime().async_database, item)

    def __getitem__(self, key: str) -> Any:
        return get_mongo_runtime().async_database[key]


db = _AsyncDatabaseProxy()
