From eab3a1beba707e9f531a250a5c74a6ba462aa4fc Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 24 Apr 2016 14:34:16 +0100 Subject: Rename SelectCommand to CursorSelectCommand --- libpqpp/pq-cursorselectcommand.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 libpqpp/pq-cursorselectcommand.h (limited to 'libpqpp/pq-cursorselectcommand.h') diff --git a/libpqpp/pq-cursorselectcommand.h b/libpqpp/pq-cursorselectcommand.h new file mode 100644 index 0000000..aafe4e1 --- /dev/null +++ b/libpqpp/pq-cursorselectcommand.h @@ -0,0 +1,40 @@ +#ifndef PQ_CURSORSELECTCOMMAND_H +#define PQ_CURSORSELECTCOMMAND_H + +#include +#include "pq-command.h" +#include +#include + +namespace PQ { + class Connection; + class Column; + class CursorSelectCommand : public DB::SelectCommand, public Command { + public: + CursorSelectCommand(Connection *, const std::string & sql, unsigned int no); + virtual ~CursorSelectCommand(); + + bool fetch() override; + void execute() override; + + private: + void fetchTuples(); + std::string mkdeclare() const; + std::string mkfetch() const; + std::string mkclose() const; + + mutable bool executed; + mutable bool txOpened; + int nTuples, tuple, fTuples; + PGresult * execRes; + std::string s_declare; + std::string s_fetch; + std::string s_close; + + friend class Column; + }; +} + +#endif + + -- cgit v1.2.3