From 55dc8fa7bef00c0d382860b2f9b0245731db2bcb Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 24 Dec 2015 04:00:01 +0000 Subject: PostgreSQL files prefixed with pq- --- libpqpp/pq-selectcommand.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 libpqpp/pq-selectcommand.h (limited to 'libpqpp/pq-selectcommand.h') diff --git a/libpqpp/pq-selectcommand.h b/libpqpp/pq-selectcommand.h new file mode 100644 index 0000000..c72c314 --- /dev/null +++ b/libpqpp/pq-selectcommand.h @@ -0,0 +1,40 @@ +#ifndef PQ_SELECTCOMMAND_H +#define PQ_SELECTCOMMAND_H + +#include +#include "pq-command.h" +#include +#include + +namespace PQ { + class Connection; + class Column; + class SelectCommand : public DB::SelectCommand, public Command { + public: + SelectCommand(const Connection *, const std::string & sql, unsigned int no); + virtual ~SelectCommand(); + + bool fetch(); + void execute(); + + 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