Skip to content
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

fix: stop using global db, use get_db instead #30

Merged
merged 3 commits into from
Nov 15, 2023
Merged

Conversation

raphodn
Copy link
Member

@raphodn raphodn commented Nov 15, 2023

What

Similar to the FastAPI docs, create a get_db() method, and add it as a Depend in the corresponding endpoints.
Avoids having global db

https://fastapi.tiangolo.com/tutorial/sql-databases/#main-fastapi-app

@raphodn raphodn self-assigned this Nov 15, 2023
@raphodn raphodn requested a review from raphael0202 November 15, 2023 18:10
@raphodn raphodn force-pushed the raphodn/price-get-with-advanced-filters branch from 99f7e02 to d645667 Compare November 15, 2023 20:06
Base automatically changed from raphodn/price-get-with-advanced-filters to main November 15, 2023 20:13
@raphodn raphodn force-pushed the raphodn/db-get-method branch from a5a544e to f1001be Compare November 15, 2023 20:26
@raphodn raphodn merged commit 9739734 into main Nov 15, 2023
4 of 5 checks passed
@raphodn raphodn deleted the raphodn/db-get-method branch November 15, 2023 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant