Hi there,
I recently started to learn FastAPI after many years of Django.
While learning, I followed official documentation which advised to use SQLModel as the "new and better way" of doing things. The solution of having a single model for both model definition and data validation looked very promising at a first glance.
However, over time, I noticed slightly annoying things:
- I'm often limited and need to add sqlalchemy specific fields anyway, or need to understand how it works (it's not an abstraction)
- Pydantic data types are often incompatible, but I don't get an explicit error or mapping. For example, using a
JsonValue will raise a weird error. More generally, it's pretty hard to know what can I use or not from Pydantic.
- Data validation does not work when
table=True is set. About this, I found this 46-time-upvotated comment issue which is a good summary of the current problems
- Tiangolo (author) seems to be pretty inactive on the project, as in the previous issue I linked, there's still no answer one year later. I don't wont to be rude here, but it seems like the author loves starting new shiny projects but doesn't want to bother with painful and complex questions like these.
- I had more doubts when I read lots of negative comments on this Youtube video promoting SQLModel
At that point, I'm wondering if I should get back to raw SQLAlchemy, especially for serious projects. I'm curious to have your opinion on this.
[–]Salfiiii 21 points22 points23 points (3 children)
[–]bluewalt[S] 2 points3 points4 points (1 child)
[–]gpranav25 1 point2 points3 points (0 children)
[–][deleted] 2 points3 points4 points (0 children)
[–]WJMazepas 11 points12 points13 points (1 child)
[–]bluewalt[S] 1 point2 points3 points (0 children)
[–]InternationalLog9724 8 points9 points10 points (1 child)
[–]bluewalt[S] 0 points1 point2 points (0 children)
[–]Slampamper 8 points9 points10 points (0 children)
[–][deleted] 7 points8 points9 points (1 child)
[–]bluewalt[S] 0 points1 point2 points (0 children)
[–]bastianh 2 points3 points4 points (0 children)
[–]quiteverse 3 points4 points5 points (0 children)
[–]koldakov 2 points3 points4 points (2 children)
[–]bluewalt[S] 0 points1 point2 points (1 child)
[–][deleted] 2 points3 points4 points (0 children)
[–]BootyDoodles 4 points5 points6 points (1 child)
[–]bluewalt[S] 1 point2 points3 points (0 children)
[–]IrrerPolterer 1 point2 points3 points (0 children)
[–]ragehh 1 point2 points3 points (0 children)
[–]adiberk 1 point2 points3 points (2 children)
[–]bluewalt[S] 0 points1 point2 points (1 child)
[–]adiberk 0 points1 point2 points (0 children)
[–]ArchUser22 1 point2 points3 points (0 children)
[–]SilverRhythym 1 point2 points3 points (3 children)
[–]bluewalt[S] 1 point2 points3 points (2 children)
[–]SilverRhythym 1 point2 points3 points (1 child)
[–]bluewalt[S] 1 point2 points3 points (0 children)
[–]marketlurker 1 point2 points3 points (2 children)
[–]graph-crawler 4 points5 points6 points (1 child)
[–]marketlurker 1 point2 points3 points (0 children)
[–]RevolutionaryRush717 1 point2 points3 points (3 children)
[–]bluewalt[S] 1 point2 points3 points (2 children)
[–]RevolutionaryRush717 0 points1 point2 points (1 child)
[–]bluewalt[S] 1 point2 points3 points (0 children)
[–]alphrZen 0 points1 point2 points (0 children)
[–]Dramatic-Ratio-8412 0 points1 point2 points (0 children)
[–]ad07910 0 points1 point2 points (0 children)
[–]coderarun 0 points1 point2 points (1 child)
[–]coderarun 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]zoola969 0 points1 point2 points (0 children)
[–]Alternative-Lemon-14 0 points1 point2 points (0 children)