summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2017-01-08 15:38:38 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2017-01-08 20:18:08 +0000
commit1bc8b0349266db6b076b3f04f79c4ec3e493b3d9 (patch)
tree2579f54dad1c04faa83bd895ac0bfb675a204458
parentMinor updates/tweaks to increase test coverage (diff)
downloadlibdbpp-postgresql-1bc8b0349266db6b076b3f04f79c4ec3e493b3d9.tar.bz2
libdbpp-postgresql-1bc8b0349266db6b076b3f04f79c4ec3e493b3d9.tar.xz
libdbpp-postgresql-1bc8b0349266db6b076b3f04f79c4ec3e493b3d9.zip
Add the DB command options factory
-rw-r--r--libpqpp/pq-command.cpp9
-rw-r--r--libpqpp/pq-command.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/libpqpp/pq-command.cpp b/libpqpp/pq-command.cpp
index 5ff83f0..1db81a6 100644
--- a/libpqpp/pq-command.cpp
+++ b/libpqpp/pq-command.cpp
@@ -4,6 +4,9 @@
#include <string.h>
#include <compileTimeFormatter.h>
#include <boost/date_time/posix_time/posix_time.hpp>
+#include <factory.h>
+
+NAMEDFACTORY("postgresql", PQ::CommandOptions, DB::CommandOptionsFactory);
AdHocFormatter(PQCommondStatement, "pStatement_id%?");
PQ::Command::Command(Connection * conn, const std::string & sql, const DB::CommandOptions * opts) :
@@ -26,6 +29,12 @@ PQ::Command::~Command()
}
}
+PQ::CommandOptions::CommandOptions(std::size_t hash, const DB::CommandOptionsMap &) :
+ DB::CommandOptions(hash)
+{
+
+}
+
PQ::CommandOptions::CommandOptions(std::size_t hash,
unsigned int ft,
bool uc) :
diff --git a/libpqpp/pq-command.h b/libpqpp/pq-command.h
index e054da8..7612262 100644
--- a/libpqpp/pq-command.h
+++ b/libpqpp/pq-command.h
@@ -12,6 +12,7 @@ namespace PQ {
class DLL_PUBLIC CommandOptions : public DB::CommandOptions {
public:
+ CommandOptions(std::size_t, const DB::CommandOptionsMap &);
CommandOptions(std::size_t hash,
unsigned int fetchTuples = 35,
bool useCursor = true);