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

Function read_heroes

docs_src/sql_databases/tutorial002_an_py310.py:66–72  ·  view source on GitHub ↗
(
    session: SessionDep,
    offset: int = 0,
    limit: Annotated[int, Query(le=100)] = 100,
)

Source from the content-addressed store, hash-verified

64
65@app.get("/heroes/", response_model=list[HeroPublic])
66def read_heroes(
67 session: SessionDep,
68 offset: int = 0,
69 limit: Annotated[int, Query(le=100)] = 100,
70):
71 heroes = session.exec(select(Hero).offset(offset).limit(limit)).all()
72 return heroes
73
74
75@app.get("/heroes/{hero_id}", response_model=HeroPublic)

Callers

nothing calls this directly

Calls 1

QueryClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…