Skip to content

Commit

Permalink
Merge pull request #3463 from lonvia/sqlalchemy14-with-psycopg
Browse files Browse the repository at this point in the history
Make sure SQLAlchemy can handle the loaded dialect
  • Loading branch information
lonvia authored Jul 2, 2024
2 parents e51973f + 8cb0d5b commit b636338
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/nominatim_api/sql/async_core_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@
"""
Import the base library to use with asynchronous SQLAlchemy.
"""
# pylint: disable=invalid-name
# pylint: disable=invalid-name, ungrouped-imports, unused-import

from typing import Any

try:
import sqlalchemy.dialects.postgresql.psycopg
import psycopg
PGCORE_LIB = 'psycopg'
PGCORE_ERROR: Any = psycopg.Error
except ModuleNotFoundError:
import sqlalchemy.dialects.postgresql.asyncpg
import asyncpg
PGCORE_LIB = 'asyncpg'
PGCORE_ERROR = asyncpg.PostgresError

0 comments on commit b636338

Please sign in to comment.