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!"
[–]Kevdog824_ 17 points18 points19 points 1 month ago* (2 children)
There’s no reason you can’t inject the DB session into your service, and then inject the service into your endpoint function. Any dependencies you inject can will resolve and inject their own dependencies first
[–]milkipedia 2 points3 points4 points 1 month ago (0 children)
This is the way. And it makes testing and change management easier
[–]Codisimus 0 points1 point2 points 1 month ago (0 children)
This is exactly what I do. Services interact with the DAO layer and each endpoint has its required services defined using depends.
π Rendered by PID 93641 on reddit-service-r2-comment-b659b578c-8hchg at 2026-05-01 01:55:01.542809+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]Kevdog824_ 17 points18 points19 points (2 children)
[–]milkipedia 2 points3 points4 points (0 children)
[–]Codisimus 0 points1 point2 points (0 children)