-
Notifications
You must be signed in to change notification settings - Fork 1
/
query.h
61 lines (36 loc) · 857 Bytes
/
query.h
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef QUERY_INCLUDED
#define QUERY_INCLUDED
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include "queryUtil.h"
#include "table.h"
#include "column.h"
class QueryUtil;
class Table;
class Column;
class Query {
public:
Query(std::string&);
void parseQuery(std::vector<std::string>*, std::string&);
void executeQuery();
void printResult();
void validateQuery();
std::string getQueryString();
// void setQueryString(std::string&);
void setTables(std::list<Table*>*);
Table* getTableByName(const std::string&);
private:
std::string command;
std::string queryString;
int queryType;
std::list<Table*> *tables;
std::vector<std::string> vQuery;
void executeCreateQuery();
void executeSelectQuery();
void executeInsertQuery();
void executeUpdateQuery();
void executeDropQuery();
};
#endif