summaryrefslogtreecommitdiff
path: root/libpqpp/pq-connection.cpp
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
commit1b43fadae00d3240f0d555f2b09bd9c36c971126 (patch)
tree6a81d5c231e8eba5787a948876282f38440e1058 /libpqpp/pq-connection.cpp
parentC++ify the SQL preparer and skip it if no variables are being bound (diff)
downloadlibdbpp-postgresql-1b43fadae00d3240f0d555f2b09bd9c36c971126.tar.bz2
libdbpp-postgresql-1b43fadae00d3240f0d555f2b09bd9c36c971126.tar.xz
libdbpp-postgresql-1b43fadae00d3240f0d555f2b09bd9c36c971126.zip
Use bulk select not cursor select for getId, far fewer operations
Diffstat (limited to 'libpqpp/pq-connection.cpp')
-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;