MCPcopy Index your code
hub / github.com/fastapi/fastapi / read_heroes

Function read_heroes

docs_src/sql_databases/tutorial002_py310.py:63–69  ·  view source on GitHub ↗
(
    session: Session = Depends(get_session),
    offset: int = 0,
    limit: int = Query(default=100, le=100),
)

Source from the content-addressed store, hash-verified

61
62@app.get("/heroes/", response_model=list[HeroPublic])
63def read_heroes(
64 session: Session = Depends(get_session),
65 offset: int = 0,
66 limit: int = Query(default=100, le=100),
67):
68 heroes = session.exec(select(Hero).offset(offset).limit(limit)).all()
69 return heroes
70
71
72@app.get("/heroes/{hero_id}", response_model=HeroPublic)

Callers

nothing calls this directly

Calls 2

DependsClass · 0.90
QueryClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…