Skip to content

ccproxy.plugins.analytics.routes

ccproxy.plugins.analytics.routes

get_duckdb_storage async

get_duckdb_storage(request)

Get DuckDB storage service from app state.

The duckdb_storage plugin registers the storage as app.state.log_storage.

Source code in ccproxy/plugins/analytics/routes.py
async def get_duckdb_storage(request: Request) -> SimpleDuckDBStorage | None:
    """Get DuckDB storage service from app state.

    The duckdb_storage plugin registers the storage as app.state.log_storage.
    """
    return getattr(request.app.state, "log_storage", None)