summaryrefslogtreecommitdiff
path: root/libpqpp/selectcommand.h
diff options
context:
space:
mode:
Diffstat (limited to 'libpqpp/selectcommand.h')
-rw-r--r--libpqpp/selectcommand.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/libpqpp/selectcommand.h b/libpqpp/selectcommand.h
new file mode 100644
index 0000000..932717d
--- /dev/null
+++ b/libpqpp/selectcommand.h
@@ -0,0 +1,36 @@
+#ifndef PQ_SELECTCOMMAND_H
+#define PQ_SELECTCOMMAND_H
+
+#include "../libdbpp/selectcommand.h"
+#include "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();
+ const DB::Column& operator[](unsigned int) const;
+ const DB::Column& operator[](const Glib::ustring&) const;
+ unsigned int columnCount() const;
+ unsigned int getOrdinal(const Glib::ustring&) const;
+ private:
+ mutable bool executed;
+ std::vector<Column *> fields;
+ std::map<Glib::ustring, Column *> fieldsName;
+ int nTuples, tuple;
+ PGresult * execRes;
+
+ friend class Column;
+ };
+}
+
+#endif
+
+