2 Functions for bringing auxiliary data in the database up-to-date.
4 from ..db.utils import execute_file
6 def update_postcodes(conn, datadir):
7 """ Recalculate postcode centroids and add, remove and update entries in the
8 location_postcode table. `conn` is an opne connection to the database.
10 execute_file(conn, datadir / 'sql' / 'update-postcodes.sql')
13 def recompute_word_counts(conn, datadir):
14 """ Compute the frequency of full-word search terms.
16 execute_file(conn, datadir / 'sql' / 'words_from_search_name.sql')