summaryrefslogtreecommitdiff
path: root/libpqpp
diff options
context:
space:
mode:
authorDan Goodliffe <daniel.goodliffe@pressassociation.com>2017-01-04 17:50:22 +0000
committerDan Goodliffe <daniel.goodliffe@pressassociation.com>2017-01-04 17:50:22 +0000
commit88c63c1eb011bb1f8f07d72d3e878a2471b39018 (patch)
tree50aa6b13ffc978646b30fc70fa7434d1cf5224ff /libpqpp
parentC++ify the SQL preparer and skip it if no variables are being bound (diff)
downloadlibdbpp-postgresql-88c63c1eb011bb1f8f07d72d3e878a2471b39018.tar.bz2
libdbpp-postgresql-88c63c1eb011bb1f8f07d72d3e878a2471b39018.tar.xz
libdbpp-postgresql-88c63c1eb011bb1f8f07d72d3e878a2471b39018.zip
Use bulk select not cursor select for getId, far fewer operations
Diffstat (limited to 'libpqpp')
-rw-r--r--libpqpp/pq-connection.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libpqpp/pq-connection.cpp b/libpqpp/pq-connection.cpp
index 21cbb5d..1fadde3 100644
--- a/libpqpp/pq-connection.cpp
+++ b/libpqpp/pq-connection.cpp
@@ -178,7 +178,7 @@ PQ::Connection::bulkUploadData(const char * data, size_t len) const
int64_t
PQ::Connection::insertId()
{
- CursorSelectCommand getId(this, "SELECT lastval()", pstmntNo++);
+ BulkSelectCommand getId(this, "SELECT lastval()", pstmntNo++, NULL);
int64_t id = -1;
while (getId.fetch()) {
getId[0] >> id;