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
commita6be6d86457a0b5dc982a0d4c7128a510313506d (patch)
tree1296ebbdfcd3f326013d2730e91be0c279cec0de /libpqpp/pq-connection.h
parentRefactor to use std::string as buffer and increase test coverage (diff)
downloadlibdbpp-postgresql-a6be6d86457a0b5dc982a0d4c7128a510313506d.tar.bz2
libdbpp-postgresql-a6be6d86457a0b5dc982a0d4c7128a510313506d.tar.xz
libdbpp-postgresql-a6be6d86457a0b5dc982a0d4c7128a510313506d.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);