summaryrefslogtreecommitdiff
path: root/libpqpp/pq-cursorselectcommand.h
blob: 6182d3f87e1390c33cbea7259aac4b86ae302e44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef PQ_CURSORSELECTCOMMAND_H
#define PQ_CURSORSELECTCOMMAND_H

#include <selectcommand.h>
#include "pq-selectbase.h"
#include "pq-command.h"
#include <vector>
#include <map>

namespace PQ {
	class Connection;
	class Column;
	class CursorSelectCommand : public DB::SelectCommand, public SelectBase, 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 fTuples;
			std::string s_declare;
			std::string s_fetch;
			std::string s_close;
	};
}

#endif