4 ms·
Based on that, do you find SQLModel[0] to be an elegant integration of these ideas, or a horrid ball of spaghetti? [0] https://sqlmodel.tiangolo.com/ https://s
by pbronez 2y ago
Based on that, do you find SQLModel[0] to be an elegant integration of these ideas, or a horrid ball of spaghetti?
[0] https://sqlmodel.tiangolo.com/ https://sqlmodel.tiangolo.com/
- unculture 2y agoSQLModel is supposed to be the best of both Pydantic and SQLAlchemy, but by design an SQLModel entity backed by a database table doesn't validate its fields on creation, which is the point of Pydantic. https://github.com/fastapi/sqlmodel/issues/52#issuecomment-1311987732 https://github.com/fastapi/sqlmodel/issues/52#issuecomment-1...
- psd1 2y agoI can't take a position without looking under the hood, but what concerns me is "SqlModel is both a pydantic model and an SA model", which makes me think it may still have the dynamic unintended-query characteristics that I'm warning about. I seem to recall using SqlModel in a pet project and having difficulty expressing many-to-many relationships, but that's buried in some branch somewhere. I recall liking the syntax more than plain SA. I suspect the benefits of SqlModel are syntactical rather than systemic? "Spaghetti" is an unrelated problem. My problem codebase was spaghetti, and that likely increased the problem surface, but sensible code doesn't eliminate the danger