DEPRECATED PATTERNS — do NOT generate these. Use the modern alternative.

SQLAlchemy:
  ✗ from sqlalchemy.ext.declarative import declarative_base → ✓ from sqlalchemy.orm import DeclarativeBase
  ✗ Base = declarative_base() → ✓ class Base(DeclarativeBase): pass
  ✗ Column(Integer, primary_key=True) → ✓ Mapped[int] = mapped_column(primary_key=True)
  ✗ Column(String(255)) → ✓ Mapped[str] = mapped_column(String(255))
  ✗ session.query(User).filter_by(name="x").all() → ✓ session.execute(select(User).filter_by(name="x")).scalars().all()
  ✗ session.query(User).get(5) → ✓ session.get(User, 5)
  ✗ MetaData(bind=engine) → ✓ metadata.create_all(engine)

Pydantic:
  ✗ class Config: orm_mode = True → ✓ model_config = ConfigDict(from_attributes=True)
  ✗ .dict() → ✓ .model_dump()
  ✗ .json() → ✓ .model_dump_json()
  ✗ parse_obj() → ✓ model_validate()
  ✗ @validator → ✓ @field_validator
  ✗ @root_validator → ✓ @model_validator
  ✗ Optional[str] (auto-None in v1) → ✓ str | None = None (explicit default in v2)
  ✗ ConstrainedInt → ✓ Annotated[int, Field(ge=0)]

FastAPI:
  ✗ status_code=201 → ✓ status_code=status.HTTP_201_CREATED (readable)
  ✗ Manual exception strings → ✓ HTTPException(status_code=404, detail="Not found")
  ✗ .dict() in handlers → ✓ .model_dump() (Pydantic v2)

Python:
  ✗ Optional[str] → ✓ str | None (PEP 604, Python 3.10+)
  ✗ List[str] → ✓ list[str] (PEP 585, Python 3.9+)
  ✗ Dict[str, int] → ✓ dict[str, int]
  ✗ Tuple[int, ...] → ✓ tuple[int, ...]
