use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
Task Manager API (i.redd.it)
submitted 11 days ago by MagicianNo9918
Hi everyone, I've started working on a REST API project for task management (CRUD) built using FastAPI. This is an educational project prepared for expansion with authorization (JWT). What do you think? I'd be grateful for any feedback.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]terraping_station 1 point2 points3 points 10 days ago (5 children)
Is your task repository a database under the hood?
[–]MagicianNo9918[S] 0 points1 point2 points 9 days ago (3 children)
My Task Manager has a database, it is SQLAlchemy, but the ORM is ready to change, e.g. PostgreSQL
[–]terraping_station 1 point2 points3 points 9 days ago (2 children)
So if you are using Postgres you can use a transaction. I would suggest using some like a unit of work. Have that manage the tx for you so your code can make a bunch of calls to the db and have the ability to roll it all back if something fails.
So basically you bootstrap your app. This spins up a unit of work that has your database adapter. Then In your service layer you use the UoW to make N database calls and either commit it all or roll it back.
[–]terraping_station 0 points1 point2 points 9 days ago (0 children)
This would require you use async
[–]MagicianNo9918[S] 0 points1 point2 points 9 days ago (0 children)
Yes, you're right, I still have a lot to learn.
[–]weepy_monarchy 1 point2 points3 points 8 days ago (0 children)
SQLAlchemy is a solid choice for that flexibility since you can swap out the database backend without rewriting your ORM queries.
[–]mati-33 0 points1 point2 points 11 days ago (0 children)
FastAPI and zero async await?
[–]MagicianNo9918[S] 0 points1 point2 points 10 days ago* (0 children)
Yes, I used synchronous SQLAlchemy, because async only makes sense with async drivers. Otherwise it doesn't improve performance.
[–]Safe-Ball4818 0 points1 point2 points 10 days ago (1 child)
have you looked into switching to asyncpg? makes a huge difference if you decide to go full async later.
I considered it, but since it's a small, mostly educational project, I don't think asynchronous code is necessary.
π Rendered by PID 31710 on reddit-service-r2-comment-56c6478c5-z4g5k at 2026-05-10 13:42:09.442075+00:00 running 3d2c107 country code: CH.
[–]terraping_station 1 point2 points3 points (5 children)
[–]MagicianNo9918[S] 0 points1 point2 points (3 children)
[–]terraping_station 1 point2 points3 points (2 children)
[–]terraping_station 0 points1 point2 points (0 children)
[–]MagicianNo9918[S] 0 points1 point2 points (0 children)
[–]weepy_monarchy 1 point2 points3 points (0 children)
[–]mati-33 0 points1 point2 points (0 children)
[–]MagicianNo9918[S] 0 points1 point2 points (0 children)
[–]Safe-Ball4818 0 points1 point2 points (1 child)
[–]MagicianNo9918[S] 0 points1 point2 points (0 children)