1 # SPDX-License-Identifier: GPL-3.0-or-later
3 # This file is part of Nominatim. (https://nominatim.org)
5 # Copyright (C) 2024 by the Nominatim developer community.
6 # For a full list of authors see the git log.
8 Import the base library to use with asynchronous SQLAlchemy.
10 # pylint: disable=invalid-name
12 from typing import Any
16 PGCORE_LIB = 'psycopg'
17 PGCORE_ERROR: Any = psycopg.Error
18 except ModuleNotFoundError:
20 PGCORE_LIB = 'asyncpg'
21 PGCORE_ERROR = asyncpg.PostgresError