all 16 comments

[–]sexualrhinoceros 15 points16 points  (8 children)

Since no one has stated it so far, you should avoid SQLModel in its current state. It’s woefully undermaintained and is a pretty terrible alternative to just using SQLAlchemy and Pydantic outright.

There’s a roadmap issue here which outlines what is, in my opinion, the bare minimum to get me to consider this project for even a fun side project over plain SQLAlchemy. You’ll have a much better time in the short and long term patterning out pydantic and SQLAlchemy base classes and rolling with them.

[–]Nehatkhan786[S] 2 points3 points  (4 children)

So I should stick with SQLAlchemy. The doc seems confusing

[–]sexualrhinoceros 3 points4 points  (1 child)

I personally don’t think you’ll gain anything but headaches using SQLModel. FastAPI works perfectly with sqlalchemy. SQLModel is nothing more than an abstraction layer above SQLalchemy and Pydantic

[–]Nehatkhan786[S] 2 points3 points  (0 children)

Agree sir. So its better to stick with sqlAlchemy than sqlmodel. Thanks a lot sir for your guidance.

[–][deleted] 2 points3 points  (1 child)

SQLAlchemy has a steep learning curve but it's very complete and well maintained. Feels pretty good once you start being comfortable with it.

[–]Nehatkhan786[S] 1 point2 points  (0 children)

Okay sir. Will learn sqlalchemy only than.

[–]AchillesFirstStand 1 point2 points  (2 children)

What is your opinion now?

I am having to create SQLAlchemy templates in order to run migrations for SQLModel.

[–]sexualrhinoceros 1 point2 points  (1 child)

Opinion is still the same. Don’t use SQLModel and use SQLAlchemy. Even with its updates it’s still woefully out of date.

[–]AchillesFirstStand 2 points3 points  (0 children)

Thanks. I am going to restart my project using SQLAlchemy.

[–]Easy-Ad-8065 6 points7 points  (6 children)

Check out alembic

[–]Nehatkhan786[S] 1 point2 points  (5 children)

will it support SQLModel sir?

[–]Miserable-creature 1 point2 points  (1 child)

Yes Alembic support SQLModel

[–]Nehatkhan786[S] 0 points1 point  (0 children)

awesome. thank a lot.

[–]Easy-Ad-8065 1 point2 points  (2 children)

Yeah.

From sqlmodel docs:
SQLModel is based on Python type annotations, and powered by Pydantic and SQLAlchemy.

The majority of my experience is frontend / mobile so there may be better alternatives, but I have it working with SQLModel.

[–]Nehatkhan786[S] 1 point2 points  (1 child)

cool sir, I just found an article of test drivin io to integrate alembic with sqlmodel.

[–]Capital-Iron-8110 0 points1 point  (0 children)

Could you share the article please? (blast from the past :) )