https://fastapi.tiangolo.com/tutorial/sql-databases/#use-pydantics-orm_mode
with this, the Pydantic model is compatible with ORMs, and you can just declare it in the response_model argument in your path operations.
You will be able to return a database model and it will read the data from it.