X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/a987f22cfb7343289ff4ea42d8cf6979636e9c00..f52212abbd21d5139e893b53d75fff5a17893010:/docs/library/Low-Level-DB-Access.md?ds=sidebyside diff --git a/docs/library/Low-Level-DB-Access.md b/docs/library/Low-Level-DB-Access.md index 5101777e..84a40b9b 100644 --- a/docs/library/Low-Level-DB-Access.md +++ b/docs/library/Low-Level-DB-Access.md @@ -1,13 +1,13 @@ # Low-level connections The `NominatimAPIAsync` class allows to directly access the underlying -database connection to explore the data more directly. Nominatim uses +database connection to explore the raw data. Nominatim uses [SQLAlchemy](https://docs.sqlalchemy.org/) for building queries. Please refer to the documentation of the library to understand how to write SQL. To get access to a search connection, use the `begin()` function of your -API object. The function returns a context manager. Use with a `with` -statement. This returns a `SearchConnection` object described below. Its +API object. This returns a `SearchConnection` object described below +wrapped in a context manager. Its `t` property has definitions for all Nominatim search tables. For an overview of available tables, refer to the [Development Layout](../develop/Database-Layout.md) in in the development @@ -26,7 +26,7 @@ the placex table: import asyncio from pathlib import Path import sqlalchemy as sa -from nominatim.api import NominatimAPIAsync +from nominatim_api import NominatimAPIAsync async def print_table_size(): api = NominatimAPIAsync(Path('.')) @@ -45,7 +45,7 @@ asyncio.run(print_table_size()) ## SearchConnection class -::: nominatim.api.SearchConnection +::: nominatim_api.SearchConnection options: members: - scalar