def create_partition_tables(conn, config):
    """ Create tables that have explicit partitioning.
    """
    sql = SQLPreprocessor(conn, config)
    sql.run_sql_file(conn, 'partition-tables.src.sql')
def create_table_triggers(conn, config):
    """ Create the triggers for the tables. The trigger functions must already
        have been imported with refresh.create_functions().
    """
    sql = SQLPreprocessor(conn, config)
    sql.run_sql_file(conn, 'table-triggers.sql')
Exemple #3
0
def sql_preprocessor(sql_preprocessor_cfg, temp_db_conn):
    return SQLPreprocessor(temp_db_conn, sql_preprocessor_cfg)
Exemple #4
0
 def update_sql_functions(self, config):
     """ Reimport the SQL functions for this tokenizer.
     """
     with connect(self.dsn) as conn:
         sqlp = SQLPreprocessor(conn, config)
         sqlp.run_sql_file(conn, 'tokenizer/icu_tokenizer.sql')
Exemple #5
0
def sql_preprocessor(temp_db_conn, tmp_path, def_config, monkeypatch,
                     table_factory):
    monkeypatch.setenv('NOMINATIM_DATABASE_MODULE_PATH', '.')
    table_factory('country_name', 'partition INT', (0, 1, 2))
    return SQLPreprocessor(temp_db_conn, def_config, tmp_path)