Commit Graph

4093 Commits

Author SHA1 Message Date
Sarah Hoffmann
5c55c1d8a1
Merge pull request #2963 from lonvia/add-sqlalchemy-schema
Add table definitions for SQLAlchemy
2023-01-30 11:17:22 +01:00
Sarah Hoffmann
a1d4e53eb8 add pytest-asyncio as a requirement for testing 2023-01-30 09:36:17 +01:00
Sarah Hoffmann
16b6484c65 add property cache for API
This caches results from querying nominatim_properties.
2023-01-30 09:36:17 +01:00
Sarah Hoffmann
2156fd4909 adapt annotations for SQLAlchemy 2.x
It is not possible to produce type annotations that work with both
versions 1.4 and 2.0. So keep to the principle of only supporting
newest versions when it comes to mypy. This means that some types
may have to be string quoted to not cause issues when running with
SQLAlchemy 1.4.
2023-01-28 11:51:26 +01:00
Sarah Hoffmann
7f5fbe1dc7 add new geoalchemy requirement 2023-01-28 11:51:26 +01:00
Sarah Hoffmann
2e9090d121 adapt status to use SQLAlchemy tables 2023-01-28 11:51:26 +01:00
Sarah Hoffmann
23f2690c54 convert StatusResult to a dataclass
This gives us nice str() functions.
2023-01-28 11:51:26 +01:00
Sarah Hoffmann
5226cd2a0b add SQLAlchemy table schema for Nominatim tables
Also defines an extended connection object that includes access to
the table definitions. Makes it easier to access the tables from
code that has been split off into separate modules.
2023-01-28 11:51:26 +01:00
Sarah Hoffmann
c7e8a82d68
Merge pull request #2958 from lonvia/streaming-json-writer
Introduce streaming json writer for JSON output
2023-01-25 17:36:23 +01:00
Sarah Hoffmann
77bec1261e add streaming json writer for JSON output 2023-01-25 15:05:33 +01:00
Sarah Hoffmann
dfcb24061e
Merge pull request #2957 from lonvia/reorganise-api-module
Assorted improvements to the new api library module
2023-01-25 09:29:31 +01:00
Sarah Hoffmann
f85b0c6208 allow to add php-compatible endpoints
If the new setting NOMINATIM_SERVE_LEGACY_URLS is set, the servers
expose the endpoints also with the .php suffix to ensure backwards
compatibility.
2023-01-24 21:39:19 +01:00
Sarah Hoffmann
e490a30a4a add support for CORS headers
Adds the additional dependency to sanic-cors for the Sanic server.
2023-01-24 21:39:19 +01:00
Sarah Hoffmann
654b652530 factor out common server implementation code
Most of the server implementation of V1 API now resides in
api.v1.server_glue. The webframeworks only supply some glue code
which is independent to changes in the API code.
2023-01-24 21:39:19 +01:00
Sarah Hoffmann
8f4426fbc8 reorganize code around result formatting
Code is now organized by api version. So formatting has moved to
the api.v1 module. Instead of holding a separate ResultFormatter
object per result format, simply move the functions to the
formater collector and hand in the requested format as a parameter.
Thus reorganized, the api.v1 module can export three simple functions
for result formatting which in turn makes the code that uses
the formatters much simpler.
2023-01-24 17:20:51 +01:00
Sarah Hoffmann
32c1e59622 reorganize api submodule
Use a directory for the submodule where the __init__ file contains
the public API. This makes it easier to separate public interface
from the internal implementation.
2023-01-24 13:28:04 +01:00
Sarah Hoffmann
e56957f047 api: delay setup of initial database connection
Defer database setup until the first call to a function. Needs an
additional lock because the setup still needs to be done sequentially.
2023-01-24 10:56:22 +01:00
Sarah Hoffmann
3cc357bffa
Merge pull request #2955 from lonvia/fix-importance-refresh
Fix importance recalculation
2023-01-23 09:07:43 +01:00
Sarah Hoffmann
388faa2c54
Merge pull request #2954 from lonvia/remove-comma-as-separator
Remove comma as name separator
2023-01-23 09:06:23 +01:00
Sarah Hoffmann
ce9ed993c8 fix importance recalculation
The signature of the compute_importance() function has changed.
2023-01-22 22:32:16 +01:00
Sarah Hoffmann
929a13d4cd remove comma as name separator
Commas are most of the time used as a part of a name, not to
separate multiple names.

See also #2950.
2023-01-22 22:29:36 +01:00
Sarah Hoffmann
56f0d678e3 exclude names ending in :wikipedia from indexing
The wikipedia prefix is used for referencing a wikipedia article
for the given tag, not the object, so not useful to search.
2023-01-21 11:16:08 +01:00
Sarah Hoffmann
02645277c8 fix typo in argument to details CLI command
Fixes #2951.
2023-01-21 10:44:10 +01:00
Sarah Hoffmann
5f4e98e0d9 update Makefile in test directory 2023-01-09 20:49:33 +01:00
Sarah Hoffmann
e9e14834bc
Merge pull request #2940 from lonvia/remove-ubuntu-18-from-actions
Actions: use Ubuntu 20 image for testing old versions of dependent software
2023-01-05 20:16:19 +01:00
Sarah Hoffmann
5a57d6308e increase minimum required version of PHP to 7.3
Other versions are not tested anymore.
2023-01-05 16:58:46 +01:00
Sarah Hoffmann
cb73d562d5 actions: move tests from Ubuntu 18 to 20
These are the tests that try to make sure old library version really
still work as expected. Increases PHP to 7.3 because 7.2 has errors.
2023-01-05 16:55:32 +01:00
Sarah Hoffmann
6c61690ef3 do not run osm2pgsql append with mutliple threads
As the updates modify the placex table, there may be deadlocks
when different objects want to forward modifications to the same
place (for example because they are both linked to it).
2023-01-05 11:34:56 +01:00
Sarah Hoffmann
bf1f6a997c
Merge pull request #2937 from lonvia/python-server-stub
Scaffolding for new Python-based search frontend
2023-01-03 14:26:33 +01:00
Sarah Hoffmann
90b29aa808
Merge pull request #2856 from t-tomek/patch-1
Update DB.php
2023-01-03 10:58:50 +01:00
Sarah Hoffmann
31d0468cd2 no type checking on old Ubuntu 18 2023-01-03 10:03:00 +01:00
Sarah Hoffmann
38f467bae3 add event handler for default connection settings 2023-01-03 10:03:00 +01:00
Sarah Hoffmann
5c7c4bb9a8 update versions for Python packages 2023-01-03 10:03:00 +01:00
Sarah Hoffmann
9646ec4edd drop official support for Ubuntu 18 2023-01-03 10:03:00 +01:00
Sarah Hoffmann
c665796c52 drop support for Python 3.6 2023-01-03 10:03:00 +01:00
Sarah Hoffmann
a72e2ecb3f update dependencies for Actions 2023-01-03 10:03:00 +01:00
Sarah Hoffmann
0c47558729 convert version to named tuple
Also return the new NominatimVersion rather than a string in the
status result.
2023-01-03 10:03:00 +01:00
Sarah Hoffmann
93b9288c30 fix error message for non-existing database 2023-01-03 10:03:00 +01:00
Sarah Hoffmann
9d31a67116 add unit tests for new Python API 2023-01-03 10:03:00 +01:00
Sarah Hoffmann
cf19036ce6 docs: extend dependency documentation 2023-01-03 10:03:00 +01:00
Sarah Hoffmann
7219ee6532 extend BDD API tests to query via Python frameworks
A new config option ENGINE allows to choose between php and any of the
supported Python engines.
2023-01-03 10:03:00 +01:00
Sarah Hoffmann
d7bc846c3c fix liniting issues and add type annotations 2023-01-03 10:03:00 +01:00
Sarah Hoffmann
1adb0a9886 add support for starlette framework 2023-01-03 10:03:00 +01:00
Sarah Hoffmann
8aa01c9c8e add support for falcon as server framework 2023-01-03 10:03:00 +01:00
Sarah Hoffmann
23dabad0b0 add sanic development server implementation 2023-01-03 10:02:53 +01:00
Sarah Hoffmann
45c675bd78 implement command line status call in Python 2023-01-03 10:02:35 +01:00
Sarah Hoffmann
860c6ecbcc
Merge pull request #2936 from lonvia/fix-query-for-index-use
Split query that deletes old objects from placex
2023-01-03 09:56:03 +01:00
Sarah Hoffmann
3f38091421 split query that deletes old objects from placex
placex only has partial indexes over OSM types, so the OSM type
needs to be hardcoded to ensure these indexes are used.
2023-01-02 17:25:38 +01:00
Sarah Hoffmann
7704b3fc7b
Merge pull request #2932 from lonvia/rework-flex-framework
Switch to osm2pgsql flex output
2022-12-29 17:23:38 +01:00
t-tomek
151b3c4021
Update DB.php 2022-12-27 08:34:20 +01:00