diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2016-04-24 15:47:33 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2016-04-24 15:47:33 +0100 |
commit | 6340b06110c35b92bfcc780e85537ca5a752a58c (patch) | |
tree | 90e66849ef16ee7fac3ae0d00900ae684996002c /libpqpp/pq-connection.cpp | |
parent | Introduce select base for different kinds of select (diff) | |
download | libdbpp-postgresql-6340b06110c35b92bfcc780e85537ca5a752a58c.tar.bz2 libdbpp-postgresql-6340b06110c35b92bfcc780e85537ca5a752a58c.tar.xz libdbpp-postgresql-6340b06110c35b92bfcc780e85537ca5a752a58c.zip |
Support bulk selects which don't use cursors, always use of RETURNING
Diffstat (limited to 'libpqpp/pq-connection.cpp')
-rw-r--r-- | libpqpp/pq-connection.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
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 <unistd.h> @@ -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++); } |