summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libpqpp/connection.cpp6
-rw-r--r--libpqpp/connection.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/libpqpp/connection.cpp b/libpqpp/connection.cpp
index 283f3ce..77bdd10 100644
--- a/libpqpp/connection.cpp
+++ b/libpqpp/connection.cpp
@@ -75,6 +75,12 @@ PQ::Connection::inTx() const
return txDepth;
}
+void
+PQ::Connection::execute(const std::string & sql) const
+{
+ checkResultFree(PQexec(conn, sql.c_str()), PGRES_COMMAND_OK, PGRES_TUPLES_OK);
+}
+
DB::BulkDeleteStyle
PQ::Connection::bulkDeleteStyle() const
{
diff --git a/libpqpp/connection.h b/libpqpp/connection.h
index 59c5858..a2cabce 100644
--- a/libpqpp/connection.h
+++ b/libpqpp/connection.h
@@ -16,6 +16,7 @@ namespace PQ {
int rollbackTx() const;
bool inTx() const;
void ping() const;
+ void execute(const std::string & sql) const override;
DB::BulkDeleteStyle bulkDeleteStyle() const;
DB::BulkUpdateStyle bulkUpdateStyle() const;