mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-26 11:08:13 +00:00
use psql for executing sql files
This allows to run larger files without needing to keep them in memory.
This commit is contained in:
@@ -12,17 +12,17 @@ from ..db.utils import execute_file
|
||||
|
||||
LOG = logging.getLogger()
|
||||
|
||||
def update_postcodes(conn, sql_dir):
|
||||
def update_postcodes(dsn, sql_dir):
|
||||
""" Recalculate postcode centroids and add, remove and update entries in the
|
||||
location_postcode table. `conn` is an opne connection to the database.
|
||||
"""
|
||||
execute_file(conn, sql_dir / 'update-postcodes.sql')
|
||||
execute_file(dsn, sql_dir / 'update-postcodes.sql')
|
||||
|
||||
|
||||
def recompute_word_counts(conn, sql_dir):
|
||||
def recompute_word_counts(dsn, sql_dir):
|
||||
""" Compute the frequency of full-word search terms.
|
||||
"""
|
||||
execute_file(conn, sql_dir / 'words_from_search_name.sql')
|
||||
execute_file(dsn, sql_dir / 'words_from_search_name.sql')
|
||||
|
||||
|
||||
def _add_address_level_rows_from_entry(rows, entry):
|
||||
|
||||
Reference in New Issue
Block a user