X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/6d39563b872b21825a61949e88bc47a0e88c7573..89094cf92e82ebb1004498fad8822975f1af4347:/nominatim/api/core.py diff --git a/nominatim/api/core.py b/nominatim/api/core.py index f975f44a..1c0c4423 100644 --- a/nominatim/api/core.py +++ b/nominatim/api/core.py @@ -101,6 +101,10 @@ class NominatimAPIAsync: #pylint: disable=too-many-instance-attributes dburl = sa.engine.URL.create('sqlite+aiosqlite', database=params.get('dbname')) + if not ('NOMINATIM_DATABASE_RW' in self.config.environ + and self.config.get_bool('DATABASE_RW')) \ + and not Path(params.get('dbname', '')).is_file(): + raise UsageError(f"SQlite database '{params.get('dbname')}' does not exist.") else: dsn = self.config.get_database_params() query = {k: v for k, v in dsn.items()