-
Notifications
You must be signed in to change notification settings - Fork 15
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
EXPERIMENTAL: Refactor #272
Conversation
Hi Rhys. I think the idea is to move code out of database logic and into core. This is to make it as easy as possible for someone to implement their own custom backend / database solution. Core is more like If you look at one of the original stac-fastapi backends, stac-fastapi-sqlaclchemy is the best example, you can see that there is a fair amount of code that is almost identical to what we use here in core. The idea is to take the common code out of these backends and put them in one place so everything is easier to maintain. If we move code to database logic from core then at some point we don't need core anymore and then we have reversed everything :) The idea is that only |
I was thinking a little bit about moving this to the core library - https://github.com/stac-utils/stac-fastapi-sqlalchemy - it used to be popular but now it is not even being maintained. |
That's a very good point and I agree. I don't think I put my idea across very well and it's probably better to separate into two points.
Closing this pull request as I think we're on the same page with the important part 👍 |
Moving shared code to base_database_logic may be a really good idea. I am not sure what you asking about stac-fastapi-sqlalchemy and stac-fastapi. |
Originally there was just the stac-fastapi repo. That repo had two |
The logic that all of the backends share could maybe be moved back to the main stac-fastapi repo someday |
Ah I didn't know the history but that explains the shared logic thank you.
I thought this might have meant that the shared code would live in stac-fastapi-sqlalchemy so wanted to just double check that it would be the main stac-fastapi repo that shared code would be moved too. |
Description:
@jonhealy1 I liked what you'd done with the sharing of code between elasticsearch and opensearch in
core
and wondered if it could be taken further.I've moved the database specific code to the database logic (only for elasticsearch so far). This removes all database specific code from
core.py
. If something similar could be done for the other backend this could be move to stac-fastapi. I think other parts likebase_database_logic
,extensions
,models
, andutils
could also be moved/shared.Possible benefits:
I wanted to check this was something positive before I went to far down the rabbit hole.
PR Checklist:
pre-commit run --all-files
)make test
)