Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I faced this exact problem a few days ago i.e. having to build one model for SQLAlchemy and an identical Pydantic model to validate the data (outside of the FastAPI context)! Will be using it the next I need it.

@tiangolo I would like to use this for production at work, however I'm a bit hesitant about using the 0.0.x versions. Would you recommend me to wait until version 0.1.0 or 1.0.0?



I just released it yesterday, so almost no one is using it in prod (I bet there's a couple using it already).

But it's all SQLAlchemy underneath, the most wiidely used Python SQL library, with tons of years of usage, so that gives some safety.

And the test coverage is at 97%. I will release 0.1.0 once test coverage reaches 100% and I have the main docs I want there.

The only caveat with the version is upgrades, as, as of now, anything could change (probably I won't change anything, just add stuff). But you can solve it by pinning the version, writing tests, and upgrading the version only after tests pass.

The only other issue you might have is that you really want to do some very advanced trick with SQLAlchemy and in some way it's still not supported. In that case you might want to use SQLAlchemy directly for that model, you can mix SQLAlchemy and SQLModel (although I haven't documented that yet).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: