summaryrefslogtreecommitdiff
path: root/libpqpp/pq-cursorselectcommand.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libpqpp/pq-cursorselectcommand.cpp')
-rw-r--r--libpqpp/pq-cursorselectcommand.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/libpqpp/pq-cursorselectcommand.cpp b/libpqpp/pq-cursorselectcommand.cpp
index 820518f..1981bc8 100644
--- a/libpqpp/pq-cursorselectcommand.cpp
+++ b/libpqpp/pq-cursorselectcommand.cpp
@@ -7,14 +7,11 @@ AdHocFormatter(PQCursorSelectDeclare, "DECLARE %? NO SCROLL CURSOR WITH HOLD FOR
AdHocFormatter(PQCursorSelectFetch, "FETCH %? IN %?");
AdHocFormatter(PQCursorSelectClose, "CLOSE %?");
-PQ::CursorSelectCommand::CursorSelectCommand(Connection * conn, const std::string & sql, const PQ::CommandOptionsCPtr & pqco, const DB::CommandOptionsCPtr & opts) :
+PQ::CursorSelectCommand::CursorSelectCommand(Connection * conn, const std::string & sql,
+ const PQ::CommandOptionsCPtr & pqco, const DB::CommandOptionsCPtr & opts) :
DB::Command(sql),
- PQ::SelectBase(sql, pqco),
- PQ::Command(conn, sql, opts),
- executed(false),
- fTuples(pqco ? pqco->fetchTuples : 35),
- s_fetch(PQCursorSelectFetch::get(fTuples, stmntName)),
- s_close(PQCursorSelectClose::get(stmntName))
+ PQ::SelectBase(sql, pqco), PQ::Command(conn, sql, opts), executed(false), fTuples(pqco ? pqco->fetchTuples : 35),
+ s_fetch(PQCursorSelectFetch::get(fTuples, stmntName)), s_close(PQCursorSelectClose::get(stmntName))
{
}
@@ -41,8 +38,8 @@ PQ::CursorSelectCommand::execute()
if (s_declare.empty()) {
s_declare = mkdeclare();
}
- c->checkResultFree(
- PQexecParams(c->conn, s_declare.c_str(), values.size(), nullptr, &values.front(), &lengths.front(), &formats.front(), binary),
+ c->checkResultFree(PQexecParams(c->conn, s_declare.c_str(), values.size(), nullptr, &values.front(),
+ &lengths.front(), &formats.front(), binary),
PGRES_COMMAND_OK);
fetchTuples();
createColumns(execRes);
@@ -53,7 +50,8 @@ PQ::CursorSelectCommand::execute()
void
PQ::CursorSelectCommand::fetchTuples()
{
- execRes = c->checkResult(PQexecParams(c->conn, s_fetch.c_str(), 0, nullptr, nullptr, nullptr, nullptr, binary), PGRES_TUPLES_OK);
+ execRes = c->checkResult(
+ PQexecParams(c->conn, s_fetch.c_str(), 0, nullptr, nullptr, nullptr, nullptr, binary), PGRES_TUPLES_OK);
nTuples = PQntuples(execRes);
tuple = -1;
}
@@ -79,4 +77,3 @@ PQ::CursorSelectCommand::fetch()
return false;
}
}
-