Fastapi: Typing in with async fastapi and encode/databases

Created on 14 May 2020  路  2Comments  路  Source: tiangolo/fastapi

First check

  • [x] I used the GitHub search to find a similar issue and didn't find it.
  • [x] I searched the FastAPI documentation, with the integrated search.
  • [x] I already searched in Google "How to X in FastAPI" and didn't find any information.

Description

Will the documentation of https://fastapi.tiangolo.com/advanced/async-sql-databases/ include types in the future? I am currently writing a application with fastapi and encode/databases but after looking into databases i can see that it returns a low level RowProxy object from sqlalchemy. I know that pydantic handles the mapping to the result, but it would be nice to have some type hints in the code. Like that people could see what the database layer returns and don't have to go debug like i did :-)

answered question

Most helpful comment

@tiangolo thanks for the response. you are right. encode/databases is not really an orm. its just a layer above sqlalchemy core api. i will close the issue. also fastapi is really awesome :)

All 2 comments

In that case you are probably looking for an ORM and not encode/databases.

If you want async, you can probably check Tortoise ORM, Gino, or Encode/ORM.

@tiangolo thanks for the response. you are right. encode/databases is not really an orm. its just a layer above sqlalchemy core api. i will close the issue. also fastapi is really awesome :)

Was this page helpful?
0 / 5 - 0 ratings