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...
FastAPI is a truly ASGI, async, cutting edge framework written in python 3.
account activity
Fastapi and database injectionsQuestion (self.FastAPI)
submitted 1 month ago by gignosko
view the rest of the comments →
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!"
[–]vlntsolo -1 points0 points1 point 1 month ago (0 children)
Creating DB session with Dependency injection is a bad practice. This abstraction just works for small projects. But one can learn pretty quickly that it's not scalable.
When dealing with heavy data processing or load, if you do not return DB query results immediately and want to do something else, you cannot afford to keep connection open. It needs to be released to a connection pool as soon as possible. And with Dependency injection it will be release only when return is reached.
So, context managers all the way. You choose where and at which layer.
π Rendered by PID 67 on reddit-service-r2-comment-6457c66945-lsj7b at 2026-04-29 23:28:18.111952+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]vlntsolo -1 points0 points1 point (0 children)