-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: SQL model for collections #5
Conversation
Starting with this since it is outside the main API and let's me figure out the ORM and interaction with the API methods, etc.
@@ -19,6 +19,9 @@ class Config: | |||
env_file = ".env" | |||
env_file_encoding = "utf-8" | |||
|
|||
DB: str = "sqlite:///database.db?check_same_thread=false" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This supports the databases that sql alchemy does (eg., postgres:///
or postgres+asyncpg:///
for async) which seems nice. Although it's worth noting right now that since this uses a local file, it is non-persistent (need to tweak docker compose to give this a volume).
@@ -114,7 +117,7 @@ def custom_generate_unique_id_function(route: APIRoute) -> str: | |||
from a variety of sources -- documents, web pages, audio, etc. | |||
""", | |||
"servers": [ | |||
{"url": "http://127.0.0.1:8000", "description": "Local server"}, | |||
{"url": "http://localhost:8000", "description": "Local server"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes a problem with CORS and the /docs
site making calls.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that's the dependency injection they were talking about. Magic!
That part is the:
which let's me do |
Starting with this since it is outside the main API and let's me figure out the ORM and interaction with the API methods, etc.