summaryrefslogtreecommitdiff
path: root/libpqpp/pq-connection.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2016-02-25 22:24:53 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2016-02-25 22:24:53 +0000
commit25a8f2a606dfbb1c4960f2ef1a14e64667e691d7 (patch)
tree889c020a1681e1c9088c3af45d95ea29c9061f90 /libpqpp/pq-connection.h
parentRefactor to use std::string as buffer and increase test coverage (diff)
downloadlibdbpp-postgresql-25a8f2a606dfbb1c4960f2ef1a14e64667e691d7.tar.bz2
libdbpp-postgresql-25a8f2a606dfbb1c4960f2ef1a14e64667e691d7.tar.xz
libdbpp-postgresql-25a8f2a606dfbb1c4960f2ef1a14e64667e691d7.zip
Reuse prepared statements
Diffstat (limited to 'libpqpp/pq-connection.h')
-rw-r--r--libpqpp/pq-connection.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/libpqpp/pq-connection.h b/libpqpp/pq-connection.h
index 59b200c..1e9f265 100644
--- a/libpqpp/pq-connection.h
+++ b/libpqpp/pq-connection.h
@@ -2,6 +2,7 @@
#define PQ_CONNECTION_H
#include <connection.h>
+#include <set>
#include <libpq-fe.h>
#include <visibility.h>
#include "pq-error.h"
@@ -14,6 +15,9 @@ namespace PQ {
class DLL_PUBLIC Connection : public DB::Connection {
public:
+ typedef std::hash<std::string>::result_type StatementHash;
+ typedef std::map<StatementHash, std::string> PreparedStatements;
+
Connection(const std::string & info);
~Connection();
@@ -38,6 +42,7 @@ namespace PQ {
void checkResultFree(PGresult * res, int expected, int alternative = -1) const;
PGconn * conn;
+ PreparedStatements preparedStatements;
private:
static bool checkResultInt(PGresult * res, int expected, int alternative);