fixed schema creation
This commit is contained in:
@@ -111,10 +111,10 @@ utils::result<std::unique_ptr<sql::query_result_impl>, utils::error> postgres_co
|
||||
std::string postgres_connection::generate_statement_name(const sql::query_context &query) {
|
||||
std::stringstream name;
|
||||
name << query.table_name << "_" << query.command_name;
|
||||
auto result = postgres_connection::statement_name_map_.find(name.str());
|
||||
auto result = statement_name_map_.find(name.str());
|
||||
|
||||
if (result == postgres_connection::statement_name_map_.end()) {
|
||||
result = postgres_connection::statement_name_map_.insert(std::make_pair(name.str(), 0)).first;
|
||||
if (result == statement_name_map_.end()) {
|
||||
result = statement_name_map_.insert(std::make_pair(name.str(), 0)).first;
|
||||
}
|
||||
|
||||
name << "_" << ++result->second;
|
||||
@@ -123,7 +123,7 @@ std::string postgres_connection::generate_statement_name(const sql::query_contex
|
||||
}
|
||||
|
||||
utils::result<std::unique_ptr<sql::statement_impl>, utils::error> postgres_connection::prepare(const sql::query_context &context) {
|
||||
auto statement_name = postgres_connection::generate_statement_name(context);
|
||||
auto statement_name = generate_statement_name(context);
|
||||
|
||||
const PGresult *result = PQprepare(conn_, statement_name.c_str(), context.sql.c_str(),
|
||||
static_cast<int>(context.bind_vars.size()), nullptr);
|
||||
|
||||
Reference in New Issue
Block a user