# RuntimeWarning: coroutine 'get_db' was never awaited

- **ID:** `python/fastapi-depends-async-generator-not-closed`
- **Domain:** python
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

An async dependency (async def or async generator) is used as a plain function, or Depends is missing so the coroutine is returned unawaited.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.x | active | — | — |

## Workarounds

1. **** (93% success)
   ```
   Declare the dependency with Depends:
def route(db=Depends(get_db)): ...
   ```
2. **** (88% success)
   ```
   Use an async generator dependency that yields and cleans up in finally.
   ```

## Dead Ends

- **** — Blocks the event loop and may break async DB drivers. (60% fail)
- **** — Returns a coroutine/generator you then misuse; resources leak. (80% fail)
