Commit Graph

4570 Commits

Author SHA1 Message Date
Sarah Hoffmann
8e90fa3395 avoid closure variables in lambda statements
There is a bug in SQLAlchemy that assigns the wrong value to bind
parameters from closure variables when reusing lambda statements
that are later extended with other non-lambda expressions.

Thus either avoid lambda statements with closure variables or extending
them with non-lambda expressions.
2024-01-05 17:49:28 +01:00
Sarah Hoffmann
02af0a2c87 use correct SQLAlchemy pool for asynchronous connections
See https://github.com/sqlalchemy/sqlalchemy/issues/8771
2024-01-02 16:15:44 +01:00
Sarah Hoffmann
fa4e5513d1 API: avoid engine disposal on startup 2024-01-02 16:10:30 +01:00
Sarah Hoffmann
93afe5a7c3 update typing for latest changes in SQLAlchemy 2023-12-29 20:55:33 +01:00
Sarah Hoffmann
af85ad390f
Merge pull request #3273 from lonvia/search-with-sqlite
Add forward search capability for SQLite databases
2023-12-12 12:15:22 +01:00
Sarah Hoffmann
ab45db5360 add minimal documentation for the SQLite usage 2023-12-09 16:30:31 +01:00
Sarah Hoffmann
89094cf92e 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.
2023-12-07 10:24:53 +01:00
Sarah Hoffmann
3f5484f48f enable search for sqlite conversion by default 2023-12-07 09:33:42 +01:00
Sarah Hoffmann
ff06b64329 enable all BDD API tests for sqlite 2023-12-07 09:32:02 +01:00
Sarah Hoffmann
6d39563b87 enable all API tests for sqlite and port missing features 2023-12-07 09:32:02 +01:00
Sarah Hoffmann
0d840c8d4e extend sqlite converter for search tables 2023-12-07 09:31:00 +01:00
Sarah Hoffmann
381bd0b576 remove unused function 2023-12-07 09:31:00 +01:00
Sarah Hoffmann
b5c61e0b5b improve typing for @compiles constructs
The first parameter is in fact the self parameter referring to
the function class.
2023-12-07 09:31:00 +01:00
Sarah Hoffmann
df6eddebcd void unnecessary aliases 2023-12-07 09:31:00 +01:00
Sarah Hoffmann
b6c8c0e72b factor out SQL for filtering by location
Also improves on the decision if an indexed is used or not.
2023-12-07 09:31:00 +01:00
Sarah Hoffmann
b06f5fddcb simplify handling of SQL lookup code for search_name
Use function classes which can be instantiated directly.
2023-12-07 09:31:00 +01:00
Sarah Hoffmann
8791c6cb69 correctly close API objects during testing 2023-12-07 09:31:00 +01:00
Sarah Hoffmann
615b166c68 clean up ST_DWithin and intersects() functions
A non-index version of ST_DWithin is not necessary. ST_Distance
can be used for that purpose. Index use for intersects can be
covered with a simple parameter.
2023-12-07 09:31:00 +01:00
Sarah Hoffmann
c41f2fed21 simplify weigh_search() function
Use JSON arrays which can have mixed types and therefore have
a more logical structure than separate arrays. Avoid JSON dicts
because of their verboseness.
2023-12-07 09:31:00 +01:00
Sarah Hoffmann
05e47fbb28 fix parameter formatting in sqlite debug output 2023-12-07 09:31:00 +01:00
Sarah Hoffmann
1b7c8240ba enable connection pools for sqlite
Connecting is reasonably expensive because the spatialite extension
needs to be loaded. Disable pooling for tests because there is some
memory leak when quickly opening and closing QueuePools with sqlite
connections.
2023-12-07 09:31:00 +01:00
Sarah Hoffmann
c4fd3ab97f hide type differences between Postgres and Sqlite in custom types
Also define a custom set of operators in preparation of differences
in implementation.
2023-12-07 09:31:00 +01:00
Sarah Hoffmann
8c7140d92b
Merge pull request #3108 from mtmail/remove-legacy-wikipedia-tag-syntax
These days the OSM wikipedia tab no longer contains URLs
2023-12-07 09:24:32 +01:00
Sarah Hoffmann
3969ce0f55
Merge pull request #3268 from mtmail/wikipedia-file-path-warning
Improve error message when Wikipedia importance file is not found
2023-12-07 09:21:59 +01:00
Robbe Haesendonck
4f5f5ea8fc Removed unnecessary check for --prepare-database flag 2023-12-07 09:04:33 +01:00
Robbe Haesendonck
5f7cc91cf9 Connect using localhost instead of socket 2023-12-07 09:04:33 +01:00
Robbe Haesendonck
424c1f0d41 Added changing permissions of nominatim-project dir 2023-12-07 09:04:33 +01:00
Robbe Haesendonck
cff05394a1 Added osm-import to sudoers file for tokenizer setup 2023-12-07 09:04:33 +01:00
Robbe Haesendonck
638b40c3ec Fixing CI tests for install-no-superuser 2023-12-07 09:04:33 +01:00
Robbe Haesendonck
53d2050dc5 Fixed typechecking error 2023-12-07 09:04:33 +01:00
Robbe Haesendonck
97ac036df5 Added missing return types to functions 2023-12-07 09:04:33 +01:00
Robbe Haesendonck
482f7fe3ba CI tests: Removed creation of user www-data.
Removed creation of user www-data as it already exists
2023-12-07 09:04:33 +01:00
Robbe Haesendonck
567c31ab6a Fixed legacy import command
Check whether prepare-database is true, if so exit early
2023-12-07 09:04:33 +01:00
Robbe Haesendonck
7d28fc35d1 Disabled pylint too-many-branches 2023-12-07 09:04:33 +01:00
Robbe Haesendonck
c06f902398 Fixed setting tokenizer property 2023-12-07 09:04:33 +01:00
Robbe Haesendonck
59ae63e6f5 Updated no-superuser install ci test
Added nominatim_database_webuser (www-data).
Set non-superuser password for importing
2023-12-07 09:04:33 +01:00
Robbe Haesendonck
9c7d947fd1 Updated check to see if osm_file is set 2023-12-07 09:04:33 +01:00
Robbe Haesendonck
58db0ad6d8 Fixed formatting 2023-12-07 09:04:33 +01:00
Robbe Haesendonck
3b09c39dbf Updated ci tests to reflect changes in Nominatim CLI 2023-12-07 09:04:33 +01:00
Robbe Haesendonck
db917cb0d4 Made sure legacy import command still works 2023-12-07 09:04:33 +01:00
Robbe Haesendonck
ba6cdd875d Removed unused variable, fixed connection 2023-12-07 09:04:33 +01:00
Robbe Haesendonck
d231ff60ed Removed _is_complete_import check 2023-12-07 09:04:33 +01:00
Robbe Haesendonck
c74904d075 Improved logic.
Fixed small oversight in mutually exclusiveness of arguments
2023-12-07 09:04:33 +01:00
Robbe Haesendonck
22204050f2 Added new psql user for importing the data 2023-12-07 09:04:33 +01:00
Robbe Haesendonck
667197a47e Changed naming of flags.
Made sure legacy import is also still ok
2023-12-07 09:04:33 +01:00
Robbe Haesendonck
e8b866aa88 Added check to see if hstore is loaded 2023-12-07 09:04:33 +01:00
Robbe Haesendonck
e7b8e1a2c2 Fixed ci-tests, osm-file flag
Preparing database should work without osm-file
2023-12-07 09:04:33 +01:00
Robbe Haesendonck
279b4fd6d2 Renamed flags 2023-12-07 09:04:33 +01:00
Robbe Haesendonck
b7c83d3580 Fixed pylint warnings 2023-12-07 09:04:33 +01:00
Robbe Haesendonck
d4018f2e3b Added check for hstore extension 2023-12-07 09:04:33 +01:00