fastapi-practices / fastapi_best_architecture

基于 FastAPI 构建的前后端分离 RBAC 权限控制系统,采用独特的伪三层架构模型设计,内置 fastapi-admin 基本实现,并作为模板库免费开源
MIT License
422 stars 69 forks source link

✨ TODO #258

Open wu-clan opened 6 months ago

wu-clan commented 6 months ago

It would be great if you could provide PR.

We've fully upgraded to Pydantic-V2, but we still have some unfinished business from V1 that we'll continue to push in V2!

News:

downdawn commented 6 months ago

Fastapi Upgrade Starlette to >=0.29.0,<0.33.0 https://github.com/tiangolo/fastapi/releases/tag/0.108.0

Sqlmodel will support for Pydantic 2.0 https://github.com/tiangolo/sqlmodel/issues/654

wu-clan commented 6 months ago

I got an update push from fastapi but I'm watching https://github.com/encode/starlette/pulls and there are some amazing updates here, if they are merged Fastapi will need to continue to adapt Starlette-1.0.0, will these minor versions continue to be compatible? I'm not sure, but I don't want to consume time for minor versions.

downdawn commented 6 months ago

These projects share common developers, and we will continue to monitor them. Our existing project structure is already quite stable, with no significant issues for production. The current three-tier architecture appears to have room for further optimization, possibly by integrating SQLModel or other methods.

wu-clan commented 6 months ago

Our existing project structure is already quite stable, with no significant issues for production.

That's so cool, a solid architecture .

SQLModel is an ORM, we already have SQLA, what are your thoughts?

Repo: here

downdawn commented 6 months ago

SQLModel is both an SQLAlchemy model and a Pydantic model, so there is a possibility to further merge and simplify 'models' and 'schemas'.

We can keep an eye on this progress: Migration from SQLAlchemy to SQLModel. https://github.com/tiangolo/full-stack-fastapi-postgresql/issues/541

wu-clan commented 6 months ago

I agree with you, but I'll decline the offer.

Because SQLModel is not updated and fixed at a good pace and is missing documentation, in fact SQLModel was born here: https://github.com/tiangolo/pydantic-sqlalchemy to reduce manual schema definition and validation is great in my opinion;

Although the number of stars for SQLModel is promising, the number of users for it is much lower than for SQLA, and to use SQLModel, the users have to learn it as well,unless SQLModel is really all over the place, I'd migrate to it

downdawn commented 6 months ago

OK, I agree with you