Skip to content

Commit efb11cb

Browse files
committed
Consistently use name m_db_connection in middle-pgsql
Instead of using m_sql_conn.
1 parent 6466532 commit efb11cb

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/middle-pgsql.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ middle_pgsql_t::table_desc::table_desc(options_t const &options,
141141

142142
void middle_query_pgsql_t::exec_sql(std::string const &sql_cmd) const
143143
{
144-
m_sql_conn.exec(sql_cmd);
144+
m_db_connection.exec(sql_cmd);
145145
}
146146

147147
void middle_pgsql_t::table_desc::drop_table(
@@ -665,7 +665,7 @@ std::size_t middle_query_pgsql_t::get_way_node_locations_db(
665665

666666
// get any remaining nodes from the DB
667667
// Nodes must have been written back at this point.
668-
auto const res = m_sql_conn.exec_prepared("get_node_list", id_list());
668+
auto const res = m_db_connection.exec_prepared("get_node_list", id_list());
669669
std::unordered_map<osmid_t, osmium::Location> locs;
670670
for (int i = 0; i < res.num_tuples(); ++i) {
671671
locs.emplace(osmium::string_to_object_id(res.get_value(i, 0)),
@@ -776,7 +776,7 @@ std::size_t middle_query_pgsql_t::get_way_node_locations_flatnodes(
776776

777777
osmium::Location middle_query_pgsql_t::get_node_location_db(osmid_t id) const
778778
{
779-
auto const res = m_sql_conn.exec_prepared("get_node", id);
779+
auto const res = m_db_connection.exec_prepared("get_node", id);
780780
if (res.num_tuples() == 0) {
781781
return osmium::Location{};
782782
}
@@ -1026,7 +1026,7 @@ bool middle_query_pgsql_t::way_get(osmid_t id,
10261026
{
10271027
assert(buffer);
10281028

1029-
auto const res = m_sql_conn.exec_prepared("get_way", id);
1029+
auto const res = m_db_connection.exec_prepared("get_way", id);
10301030

10311031
if (res.num_tuples() != 1) {
10321032
return false;
@@ -1061,7 +1061,7 @@ middle_query_pgsql_t::rel_members_get(osmium::Relation const &rel,
10611061

10621062
// ...and get those ways from database
10631063
if (!way_ids.empty()) {
1064-
res = m_sql_conn.exec_prepared("get_way_list", way_ids());
1064+
res = m_db_connection.exec_prepared("get_way_list", way_ids());
10651065
wayidspg = get_ids_from_result(res);
10661066
}
10671067
}
@@ -1178,7 +1178,7 @@ bool middle_query_pgsql_t::relation_get_format1(
11781178
{
11791179
assert(buffer);
11801180

1181-
auto const res = m_sql_conn.exec_prepared("get_rel", id);
1181+
auto const res = m_db_connection.exec_prepared("get_rel", id);
11821182
if (res.num_tuples() != 1) {
11831183
return false;
11841184
}
@@ -1205,7 +1205,7 @@ bool middle_query_pgsql_t::relation_get_format2(
12051205
{
12061206
assert(buffer);
12071207

1208-
auto const res = m_sql_conn.exec_prepared("get_rel", id);
1208+
auto const res = m_db_connection.exec_prepared("get_rel", id);
12091209

12101210
if (res.num_tuples() == 0) {
12111211
return false;
@@ -1305,13 +1305,13 @@ middle_query_pgsql_t::middle_query_pgsql_t(
13051305
std::shared_ptr<node_locations_t> cache,
13061306
std::shared_ptr<node_persistent_cache> persistent_cache,
13071307
middle_pgsql_options const &options)
1308-
: m_sql_conn(connection_params, "middle.query"), m_cache(std::move(cache)),
1308+
: m_db_connection(connection_params, "middle.query"), m_cache(std::move(cache)),
13091309
m_persistent_cache(std::move(persistent_cache)), m_store_options(options)
13101310
{
13111311
// Disable JIT and parallel workers as they are known to cause
13121312
// problems when accessing the intarrays.
1313-
m_sql_conn.set_config("jit_above_cost", "-1");
1314-
m_sql_conn.set_config("max_parallel_workers_per_gather", "0");
1313+
m_db_connection.set_config("jit_above_cost", "-1");
1314+
m_db_connection.set_config("max_parallel_workers_per_gather", "0");
13151315
}
13161316

13171317
static void table_setup(pg_conn_t const &db_connection,

src/middle-pgsql.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class middle_query_pgsql_t : public middle_query_t
8585
std::size_t get_way_node_locations_flatnodes(osmium::WayNodeList *nodes) const;
8686
std::size_t get_way_node_locations_db(osmium::WayNodeList *nodes) const;
8787

88-
pg_conn_t m_sql_conn;
88+
pg_conn_t m_db_connection;
8989
std::shared_ptr<node_locations_t> m_cache;
9090
std::shared_ptr<node_persistent_cache> m_persistent_cache;
9191

0 commit comments

Comments
 (0)