diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-12-24 04:00:01 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-12-24 04:00:01 +0000 |
commit | b177499d168936da9e64a964beb22f6057880703 (patch) | |
tree | c093da732b44e713af9fad35ff70539455cc355a /libpqpp/pq-selectcommand.h | |
parent | Use parent glibmm (diff) | |
download | libdbpp-postgresql-b177499d168936da9e64a964beb22f6057880703.tar.bz2 libdbpp-postgresql-b177499d168936da9e64a964beb22f6057880703.tar.xz libdbpp-postgresql-b177499d168936da9e64a964beb22f6057880703.zip |
PostgreSQL files prefixed with pq-
Diffstat (limited to 'libpqpp/pq-selectcommand.h')
-rw-r--r-- | libpqpp/pq-selectcommand.h | 40 |
1 files changed, 40 insertions, 0 deletions
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 <selectcommand.h> +#include "pq-command.h" +#include <vector> +#include <map> + +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 + + |