File tree Expand file tree Collapse file tree 4 files changed +13
-11
lines changed
Expand file tree Collapse file tree 4 files changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -386,25 +386,19 @@ void middle_pgsql_t::node_delete(osmid_t osm_id)
386386 }
387387}
388388
389- idlist_t middle_pgsql_t::get_ids (const char * stmt, osmid_t osm_id)
390- {
391- auto const res = m_db_connection.exec_prepared (stmt, osm_id);
392- return get_ids_from_result (res);
393- }
394-
395389idlist_t middle_pgsql_t::get_ways_by_node (osmid_t osm_id)
396390{
397- return get_ids ( " mark_ways_by_node" , osm_id);
391+ return get_ids_from_db (&m_db_connection, " mark_ways_by_node" , osm_id);
398392}
399393
400394idlist_t middle_pgsql_t::get_rels_by_node (osmid_t osm_id)
401395{
402- return get_ids ( " mark_rels_by_node" , osm_id);
396+ return get_ids_from_db (&m_db_connection, " mark_rels_by_node" , osm_id);
403397}
404398
405399idlist_t middle_pgsql_t::get_rels_by_way (osmid_t osm_id)
406400{
407- return get_ids ( " mark_rels_by_way" , osm_id);
401+ return get_ids_from_db (&m_db_connection, " mark_rels_by_way" , osm_id);
408402}
409403
410404void middle_pgsql_t::way_set (osmium::Way const &way)
Original file line number Diff line number Diff line change @@ -128,8 +128,6 @@ struct middle_pgsql_t : public middle_t
128128
129129 void buffer_store_tags (osmium::OSMObject const &obj, bool attrs);
130130
131- idlist_t get_ids (const char * stmt, osmid_t osm_id);
132-
133131 table_desc m_tables[NUM_TABLES];
134132
135133 options_t const *m_options;
Original file line number Diff line number Diff line change @@ -13,6 +13,13 @@ idlist_t get_ids_from_result(pg_result_t const &result) {
1313 return ids;
1414}
1515
16+ idlist_t get_ids_from_db (pg_conn_t const *db_connection, char const *stmt,
17+ osmid_t id)
18+ {
19+ auto const res = db_connection->exec_prepared (stmt, id);
20+ return get_ids_from_result (res);
21+ }
22+
1623void create_geom_check_trigger (pg_conn_t *db_connection,
1724 std::string const &schema,
1825 std::string const &table,
Original file line number Diff line number Diff line change 1414 */
1515idlist_t get_ids_from_result (pg_result_t const &result);
1616
17+ idlist_t get_ids_from_db (pg_conn_t const *db_connection, char const *stmt,
18+ osmid_t id);
19+
1720void create_geom_check_trigger (pg_conn_t *db_connection,
1821 std::string const &schema,
1922 std::string const &table,
You can’t perform that action at this time.
0 commit comments