# AttributeError: 'AsyncSession' object has no attribute 'query'

- **ID:** `python/sqlalchemy-async-session-sync-call`
- **Domain:** python
- **Category:** type_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Using synchronous session methods like session.query() on an AsyncSession; async sessions require awaitable methods.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.4.x | active | — | — |
| 2.0.x | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   Use SQLAlchemy 2.0 style: result = await session.execute(select(User).where(User.id == 1))
   ```
2. **** (50% success)
   ```
   For legacy, use AsyncSession with sync_session_factory but that's not recommended.
   ```

## Dead Ends

- **** — AsyncSession doesn't have a query method; you must use select(). (100% fail)
- **** — query() is not a coroutine; it doesn't exist. (90% fail)
