Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ table_t::table_t(table_t const &other,
// this would be premature.
if (other.sql_conn) {
connect();
prepare();
}
}

Expand Down Expand Up @@ -171,6 +172,11 @@ void table_t::start(std::string const &conninfo,
//TODO: change the type of the geometry column if needed - this can only change to a more permissive type
}

prepare();
}

void table_t::prepare()
{
//let postgres cache this query as it will presumably happen a lot
pgsql_exec_simple(sql_conn, PGRES_COMMAND_OK,
(fmt("PREPARE get_wkb (" POSTGRES_OSMID_TYPE
Expand Down
1 change: 1 addition & 0 deletions table.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class table_t

protected:
void connect();
void prepare();
void teardown();

void write_columns(taglist_t const &tags, std::vector<bool> *used);
Expand Down