From 3a69595903e29fe4dc27e3e7ba908b8875922a13 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 3 Jan 2017 21:54:21 +0000 Subject: No need for 1 line wrappers anymore --- libpqpp/pq-cursorselectcommand.cpp | 23 ++++++----------------- libpqpp/pq-cursorselectcommand.h | 2 -- 2 files changed, 6 insertions(+), 19 deletions(-) (limited to 'libpqpp') diff --git a/libpqpp/pq-cursorselectcommand.cpp b/libpqpp/pq-cursorselectcommand.cpp index fbc14eb..952da3e 100644 --- a/libpqpp/pq-cursorselectcommand.cpp +++ b/libpqpp/pq-cursorselectcommand.cpp @@ -3,6 +3,10 @@ #include "pq-error.h" #include +AdHocFormatter(PQCursorSelectDeclare, "DECLARE %? CURSOR FOR %?"); +AdHocFormatter(PQCursorSelectFetch, "FETCH %? IN %?"); +AdHocFormatter(PQCursorSelectClose, "CLOSE %?"); + PQ::CursorSelectCommand::CursorSelectCommand(Connection * conn, const std::string & sql, unsigned int no) : DB::Command(sql), PQ::SelectBase(sql), @@ -11,8 +15,8 @@ PQ::CursorSelectCommand::CursorSelectCommand(Connection * conn, const std::strin txOpened(false), fTuples(35), s_declare(mkdeclare()), - s_fetch(mkfetch()), - s_close(mkclose()) + s_fetch(PQCursorSelectFetch::get(fTuples, stmntName)), + s_close(PQCursorSelectClose::get(stmntName)) { } @@ -26,7 +30,6 @@ PQ::CursorSelectCommand::~CursorSelectCommand() } } -AdHocFormatter(PQCursorSelectDeclare, "DECLARE %? CURSOR FOR %?"); std::string PQ::CursorSelectCommand::mkdeclare() const { @@ -35,20 +38,6 @@ PQ::CursorSelectCommand::mkdeclare() const return PQCursorSelectDeclare::get(stmntName, psql); } -AdHocFormatter(PQCursorSelectFetch, "FETCH %? IN %?"); -std::string -PQ::CursorSelectCommand::mkfetch() const -{ - return PQCursorSelectFetch::get(fTuples, stmntName); -} - -AdHocFormatter(PQCursorSelectClose, "CLOSE %?"); -std::string -PQ::CursorSelectCommand::mkclose() const -{ - return PQCursorSelectClose::get(stmntName); -} - void PQ::CursorSelectCommand::execute() { diff --git a/libpqpp/pq-cursorselectcommand.h b/libpqpp/pq-cursorselectcommand.h index 9766f86..e7a67e6 100644 --- a/libpqpp/pq-cursorselectcommand.h +++ b/libpqpp/pq-cursorselectcommand.h @@ -20,8 +20,6 @@ namespace PQ { private: void fetchTuples(); std::string mkdeclare() const; - std::string mkfetch() const; - std::string mkclose() const; mutable bool executed; mutable bool txOpened; -- cgit v1.2.3