-
- def __init__(self, status: int, msg: str):
- self.status = status
- self.message = msg
- self.software_version = version.NOMINATIM_VERSION
- self.data_updated: Optional[dt.datetime] = None
- self.database_version: Optional[version.NominatimVersion] = None
-
-
-async def _get_database_date(conn: SearchConnection) -> Optional[dt.datetime]:
- """ Query the database date.
- """
- sql = sa.text('SELECT lastimportdate FROM import_status LIMIT 1')
- result = await conn.execute(sql)
-
- for row in result:
- return cast(dt.datetime, row[0])
-
- return None
-
-
-async def _get_database_version(conn: SearchConnection) -> Optional[version.NominatimVersion]:
- sql = sa.text("""SELECT value FROM nominatim_properties
- WHERE property = 'database_version'""")
- result = await conn.execute(sql)
-
- for row in result:
- return version.parse_version(cast(str, row[0]))
-
- return None
+ status: int
+ message: str
+ software_version = version.NOMINATIM_VERSION
+ data_updated: Optional[dt.datetime] = None
+ database_version: Optional[version.NominatimVersion] = None