From 6340b06110c35b92bfcc780e85537ca5a752a58c Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 24 Apr 2016 15:47:33 +0100 Subject: Support bulk selects which don't use cursors, always use of RETURNING --- libpqpp/pq-connection.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libpqpp/pq-connection.cpp') diff --git a/libpqpp/pq-connection.cpp b/libpqpp/pq-connection.cpp index 49867a4..078272e 100644 --- a/libpqpp/pq-connection.cpp +++ b/libpqpp/pq-connection.cpp @@ -1,5 +1,6 @@ #include "pq-connection.h" #include "pq-error.h" +#include "pq-bulkselectcommand.h" #include "pq-cursorselectcommand.h" #include "pq-modifycommand.h" #include @@ -97,6 +98,10 @@ PQ::Connection::ping() const DB::SelectCommand * PQ::Connection::newSelectCommand(const std::string & sql) { + // Yes, this is a hack + if (sql.find("libdbpp:no-cursor") != (std::string::size_type)-1) { + return new BulkSelectCommand(this, sql, pstmntNo++); + } return new CursorSelectCommand(this, sql, pstmntNo++); } -- cgit v1.2.3