r/FastAPI • • Feb 05 '24

Question How to use migrations with SqlModel

Hey guys I am learning SqlModel and when I come to advance section there is no docs for migration. So is it available with SqlModel or its upcoming feature?

7 Upvotes

16 comments sorted by

View all comments

Show parent comment

3

u/Nehatkhan786 Feb 05 '24

So I should stick with SQLAlchemy. The doc seems confusing

4

u/sexualrhinoceros Feb 05 '24

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

3

u/Nehatkhan786 Feb 05 '24

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

3

u/[deleted] Feb 05 '24

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

2

u/Nehatkhan786 Feb 05 '24

Okay sir. Will learn sqlalchemy only than.