error out when a SQLite database does not exist

Requires to mark the databse r/w when it is newly created in the
convert function.
This commit is contained in:
Sarah Hoffmann
2023-12-07 10:24:53 +01:00
parent 3f5484f48f
commit 89094cf92e
2 changed files with 6 additions and 1 deletions

View File

@@ -28,7 +28,8 @@ async def convert(project_dir: Path, outfile: Path, options: Set[str]) -> None:
try:
outapi = napi.NominatimAPIAsync(project_dir,
{'NOMINATIM_DATABASE_DSN': f"sqlite:dbname={outfile}"})
{'NOMINATIM_DATABASE_DSN': f"sqlite:dbname={outfile}",
'NOMINATIM_DATABASE_RW': '1'})
try:
async with api.begin() as src, outapi.begin() as dest: