Closed tomkralidis closed 10 months ago
I guess a simpler
if db_handler is not None: db_handler(...)
would work here instead of the rest of the changes, but regardless I'm definitely +1!
Just a small question: since this change is being made in order to accommodate SOLR backends, don't these also require some sort of handling too? Even if just waiting to see if the SOLR service is responding?
In any case, its +1 from me
+1, I've made the change above. Thanks @ricardogsilva !
Thinking more, perhaps pycsw.admin.setup_db
should turn into pycsw.core.repository.setup
, with the default being RDBMS, to which other repository plugins can update accordingly. Then docker/entrypoint.py
simply calls a repository function. Thoughts?
Having said this, my next task further abstracting the OGC API - Records code away from RDBMS, at which point the above will likely be addressed.
@epifanio: once you also can validate this PR, I'll merge accordingly.
This PR handles the DB settings in the entrypoint but the problem in "not using a DB as backend" persist when running the CSW Flask APP. As the FLASK app still depends on a DB connection.
In the Flask APP, the API
class from pycsw.ogc.api.records
:
api_ = API(APP.config['PYCSW_CONFIG'])
will make a new call to the DB from which it will build the query_mappings
I tested with the last commit it now works as expected, by running the WSGI app instead of the default Flask app.
@tomkralidis thanks!
Overview
Replaces #829. Only execute pycsw RDBMS codepath is pycsw is configured with PostgreSQL or SQLite.
cc @epifanio for validation (and whose pycsw backend is SOLR).
Related Issue / Discussion
None
Additional Information
None
Contributions and Licensing
(as per https://github.com/geopython/pycsw/blob/master/CONTRIBUTING.rst#contributions-and-licensing)