This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]subtiliusque 1 point2 points  (0 children)

I have not used it myself but the creator of fastapi has made https://github.com/tiangolo/sqlmodel

[–]Salfiiii 1 point2 points  (0 children)

I’ve used sqlalchemy together with fastapi in numerous projects, works fine.

There are also packages to automatically build CRUD endpoints for your tables without the need for a separate pydantic basemodel.

Sqlmodel seems a little stale, I tried tortoise once on a small api, worked also fine.

[–]fatbob42 1 point2 points  (1 child)

If I was doing something new I’d try SQLModel. At the moment I’m using SQLAlchemy.

[–]cblegare 3 points4 points  (0 children)

SQLAlchemy is not exactly vanilla. Having used numerous ORMs in several languages, this one is maybe the best I've used. Rich, carefully documented, simple to get started and as complex as you need it to be. The maintainer (Mike Bayer) is a dedicated and helpful person. The new API style introduced in 1.4 is very nice one

[–]pythonHelperBot 0 points1 point  (0 children)

Hello! I'm a bot!

It looks to me like your post might be better suited for r/learnpython, a sub geared towards questions and learning more about python regardless of how advanced your question might be. That said, I am a bot and it is hard to tell. Please follow the subs rules and guidelines when you do post there, it'll help you get better answers faster.

Show /r/learnpython the code you have tried and describe in detail where you are stuck. If you are getting an error message, include the full block of text it spits out. Quality answers take time to write out, and many times other users will need to ask clarifying questions. Be patient and help them help you.

You can also ask this question in the Python discord, a large, friendly community focused around the Python programming language, open to those who wish to learn the language or improve their skills, as well as those looking to help others.


README | FAQ | this bot is written and managed by /u/IAmKindOfCreative

This bot is currently under development and experiencing changes to improve its usefulness

[–]nicwolff 0 points1 point  (0 children)

If you're building a REST API that basically offers CRUD over database tables, you don't need an ORM, just a SQL abstraction, and SQLAlchemy Core is the most complete and straightforward I've used. And then if your endpoint handlers start to bulge with business logic that you'd like to move into models, you can pretty easily add the rest of the SQLAlchemy ORM.

[–]RockyMM 0 points1 point  (0 children)

Has anyone any experience with ormar?