X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/ce17b0eecaa7add29e4eb04e06b2580daa656bf2..37940803273aeab88ae37f8f6c9698478df52fc2:/nominatim/db/sqlalchemy_schema.py?ds=inline diff --git a/nominatim/db/sqlalchemy_schema.py b/nominatim/db/sqlalchemy_schema.py index 7af3d44c..2ca518ca 100644 --- a/nominatim/db/sqlalchemy_schema.py +++ b/nominatim/db/sqlalchemy_schema.py @@ -10,7 +10,7 @@ SQLAlchemy definitions for all tables used by the frontend. from typing import Any import sqlalchemy as sa -from sqlalchemy.dialects.postgresql import HSTORE, ARRAY, JSONB +from sqlalchemy.dialects.postgresql import HSTORE, ARRAY, JSONB, array from sqlalchemy.dialects.sqlite import JSON as sqlite_json from nominatim.db.sqlalchemy_types import Geometry @@ -21,6 +21,7 @@ class PostgresTypes: Composite = HSTORE Json = JSONB IntArray = ARRAY(sa.Integer()) #pylint: disable=invalid-name + to_array = array class SqliteTypes: @@ -30,6 +31,12 @@ class SqliteTypes: Json = sqlite_json IntArray = sqlite_json + @staticmethod + def to_array(arr: Any) -> Any: + """ Sqlite has no special conversion for arrays. + """ + return arr + #pylint: disable=too-many-instance-attributes class SearchTables: