summaryrefslogtreecommitdiff
path: root/libpqpp/pq-command.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2020-11-18 16:55:18 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2020-11-18 16:55:18 +0000
commit3bfa3dafe335479aade55507719071f7dceb0d8c (patch)
tree31d14618fc170a16f91f1f5c79e2ffd25f11b541 /libpqpp/pq-command.cpp
parentFixes for tidy (diff)
downloadlibdbpp-postgresql-3bfa3dafe335479aade55507719071f7dceb0d8c.tar.bz2
libdbpp-postgresql-3bfa3dafe335479aade55507719071f7dceb0d8c.tar.xz
libdbpp-postgresql-3bfa3dafe335479aade55507719071f7dceb0d8c.zip
Clang format
Diffstat (limited to 'libpqpp/pq-command.cpp')
-rw-r--r--libpqpp/pq-command.cpp29
1 files changed, 9 insertions, 20 deletions
diff --git a/libpqpp/pq-command.cpp b/libpqpp/pq-command.cpp
index 147d988..98cd725 100644
--- a/libpqpp/pq-command.cpp
+++ b/libpqpp/pq-command.cpp
@@ -1,38 +1,28 @@
#include "pq-command.h"
#include "pq-connection.h"
+#include <boost/date_time/posix_time/posix_time.hpp>
+#include <compileTimeFormatter.h>
#include <cstdlib>
#include <cstring>
-#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::CommandOptionsCPtr & opts) :
- DB::Command(sql),
- hash(opts && opts->hash ? *opts->hash : std::hash<std::string>()(sql)),
- stmntName(PQCommondStatement::get(hash)),
- c(conn)
+ DB::Command(sql), hash(opts && opts->hash ? *opts->hash : std::hash<std::string>()(sql)),
+ stmntName(PQCommondStatement::get(hash)), c(conn)
{
}
PQ::CommandOptions::CommandOptions(std::size_t hash, const DB::CommandOptionsMap & map) :
- DB::CommandOptions(hash),
- fetchTuples(get(map, "page-size", 35)),
- useCursor(!isSet(map, "no-cursor")),
+ DB::CommandOptions(hash), fetchTuples(get(map, "page-size", 35)), useCursor(!isSet(map, "no-cursor")),
fetchBinary(isSet(map, "fetch-binary"))
{
}
-PQ::CommandOptions::CommandOptions(std::size_t hash,
- unsigned int ft,
- bool uc,
- bool fb) :
- DB::CommandOptions(hash),
- fetchTuples(ft),
- useCursor(uc),
- fetchBinary(fb)
+PQ::CommandOptions::CommandOptions(std::size_t hash, unsigned int ft, bool uc, bool fb) :
+ DB::CommandOptions(hash), fetchTuples(ft), useCursor(uc), fetchBinary(fb)
{
}
@@ -72,9 +62,9 @@ PQ::Command::paramsAtLeast(unsigned int n)
}
AdHocFormatter(PQCommandParamFmt, "%?");
-template<typename ... T>
+template<typename... T>
void
-PQ::Command::paramSet(unsigned int n, const T & ... v)
+PQ::Command::paramSet(unsigned int n, const T &... v)
{
paramsAtLeast(n);
bufs[n] = std::make_unique<std::string>(PQCommandParamFmt::get(v...));
@@ -176,4 +166,3 @@ PQ::Command::bindNull(unsigned int n)
values[n] = nullptr;
bufs[n].reset();
}
-