Closed tomkralidis closed 12 months ago
If the DB is not present in the configuration - the sysytem will not start.
My config for the repository section looks like:
[repository]
database=None
table=None
source=pycsw.plugins.repository.solr_metno.SOLRMETNORepository
filter=http://SOLR-IP:8983/solr/adc
adc_collection=ADC
MMD_XSL_DIR=/usr/local/share/mmd/xslt/
➜ CSW_ADC git:(master) ✗ docker run -it -v $(pwd)/test.cfg:/etc/pycsw/pycsw.cfg epinux/pycsw:master
INFO:pycsw.core.repository:Creating database None
DEBUG:__main__:Could not parse SQLAlchemy URL from string 'None'
DEBUG:pycsw.core.config:Initializing static context
INFO:pycsw.core.repository:creating new engine: None
Traceback (most recent call last):
File "/usr/local/bin/entrypoint.py", line 144, in <module>
launch_pycsw(config, workers=workers, reload=args.reload)
File "/usr/local/bin/entrypoint.py", line 82, in launch_pycsw
repo = Repository(pycsw_config.get("repository", "database"),
File "/home/pycsw/pycsw/pycsw/core/repository.py", line 107, in __init__
self.engine = Repository.create_engine('%s' % self.database)
File "/home/pycsw/pycsw/pycsw/core/repository.py", line 76, in create_engine
engine = create_engine('%s' % url, echo=False, pool_pre_ping=True)
File "<string>", line 2, in create_engine
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/util/deprecations.py", line 375, in warned
return fn(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/create.py", line 514, in create_engine
u = _url.make_url(url)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/url.py", line 738, in make_url
return _parse_url(name_or_url)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/url.py", line 799, in _parse_url
raise exc.ArgumentError(
sqlalchemy.exc.ArgumentError: Could not parse SQLAlchemy URL from string 'None'
@tomkralidis
Overview
This PR moves RDBMS specific functionality out of the Docker entrypoint into
pycsw.core.repository
. This allows for repository backends that are not PostgreSQL/SQLite to spin up as expected (followingpycsw.core.repository
functions).This PR also moves the query mappings out of OGC API - Records code into the repository as well.
Finally, PL/Python support is removed, given most PostgreSQL installs currently would have PostGIS more easily.
As a result, pycsw.core.repository is a bit more self-contained.
cc @epifanio
Related Issue / Discussion
None
Additional Information
None
Contributions and Licensing
None (as per https://github.com/geopython/pycsw/blob/master/CONTRIBUTING.rst#contributions-and-licensing)