-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can we use this package in multiple files #4
Comments
Hi! Any news yet on this? |
I'm waiting as well. |
after using the package myself I now understand your question :) one solution is the following: when initialising the app, store the
now create your own two depends functions (similar to the ones in the init.py)
you can now use the two depend functions like the ones mentioned in the README.md, with the slight differences that you can use them across multiple files... |
in your main.py file
in your router file use like this
|
Hi my friend,
Could you please share the method to me? How can we share the database connection between multiple files. I organize my fastapi router in multiple files with APIRouter. In your package, it create a pool when fastapi project starts. How can we share this pool between multiple files?
Thanks
The text was updated successfully, but these errors were encountered: