diff options
author | Dan Goodliffe <daniel.goodliffe@pressassociation.com> | 2017-01-04 17:50:22 +0000 |
---|---|---|
committer | Dan Goodliffe <daniel.goodliffe@pressassociation.com> | 2017-01-04 17:50:22 +0000 |
commit | 1b43fadae00d3240f0d555f2b09bd9c36c971126 (patch) | |
tree | 6a81d5c231e8eba5787a948876282f38440e1058 | |
parent | C++ify the SQL preparer and skip it if no variables are being bound (diff) | |
download | libdbpp-postgresql-1b43fadae00d3240f0d555f2b09bd9c36c971126.tar.bz2 libdbpp-postgresql-1b43fadae00d3240f0d555f2b09bd9c36c971126.tar.xz libdbpp-postgresql-1b43fadae00d3240f0d555f2b09bd9c36c971126.zip |
Use bulk select not cursor select for getId, far fewer operations
-rw-r--r-- | libpqpp/pq-connection.cpp | 2 |
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; |