f8d3cbdd59
Add the FastAPI app, PostgreSQL migrations, Docker/Helm packaging, API contracts, docs, client examples, and the unit/integration/compatibility test suite for local client and tooling labs without a real vCenter.
15 lines
327 B
Python
15 lines
327 B
Python
"""FastAPI dependency adapters."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from fastapi import Request
|
|
|
|
from app.db.pool import Database
|
|
|
|
|
|
def get_database(request: Request) -> Database:
|
|
"""Resolve the lifespan-owned database from application state."""
|
|
|
|
database: Database = request.app.state.database
|
|
return database
|