summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libpqpp/connection.cpp18
-rw-r--r--libpqpp/connection.h2
2 files changed, 20 insertions, 0 deletions
diff --git a/libpqpp/connection.cpp b/libpqpp/connection.cpp
index 4330b3f..24f3c33 100644
--- a/libpqpp/connection.cpp
+++ b/libpqpp/connection.cpp
@@ -3,6 +3,11 @@
#include "selectcommand.h"
#include "modifycommand.h"
+static void
+noNoticeProcessor(void * arg, const char * message)
+{
+}
+
PQ::Connection::Connection(const std::string & info) :
conn(PQconnectdb(info.c_str())),
txDepth(0),
@@ -11,6 +16,7 @@ PQ::Connection::Connection(const std::string & info) :
if (PQstatus(conn) != CONNECTION_OK) {
throw ConnectionError();
}
+ PQsetNoticeProcessor(conn, noNoticeProcessor, NULL);
}
PQ::Connection::~Connection()
@@ -51,6 +57,18 @@ PQ::Connection::inTx() const
return txDepth;
}
+DB::BulkDeleteStyle
+PQ::Connection::bulkDeleteStyle() const
+{
+ return DB::BulkDeleteUsingUsing;
+}
+
+DB::BulkUpdateStyle
+PQ::Connection::bulkUpdateStyle() const
+{
+ return DB::BulkUpdateUsingFromSrc;
+}
+
void
PQ::Connection::ping() const
{
diff --git a/libpqpp/connection.h b/libpqpp/connection.h
index da13e6c..8dafe84 100644
--- a/libpqpp/connection.h
+++ b/libpqpp/connection.h
@@ -15,6 +15,8 @@ namespace PQ {
int rollbackTx() const;
bool inTx() const;
void ping() const;
+ DB::BulkDeleteStyle bulkDeleteStyle() const;
+ DB::BulkUpdateStyle bulkUpdateStyle() const;
DB::SelectCommand * newSelectCommand(const std::string & sql) const;
DB::ModifyCommand * newModifyCommand(const std::string & sql) const;