aboutsummaryrefslogtreecommitdiff
path: root/query.h
diff options
context:
space:
mode:
Diffstat (limited to 'query.h')
-rw-r--r--query.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/query.h b/query.h
index 1e06264..467aa7f 100644
--- a/query.h
+++ b/query.h
@@ -8,12 +8,12 @@
using namespace std;
-struct WhereClause{
+struct ColValueClause{
int col;
RowItem value;
- WhereClause(void);
- WhereClause(const int _c,const RowItem &_v);
+ ColValueClause(void);
+ ColValueClause(const int _c,const RowItem &_v);
};
@@ -47,7 +47,7 @@ struct CreateQuery : public Query{
struct FindQuery : public Query{
unsigned int limit; //-1=unlimited
- vector<WhereClause> where;
+ vector<ColValueClause> where;
FindQuery(void);
pair<vector<map<string,Row>::const_iterator>,string> executeIterators(map<string,Table> &tables);
@@ -63,8 +63,16 @@ struct InsertQuery : public Query{
QueryResult execute(map<string,Table> &tables);
};
+struct UpdateQuery : public Query{
+ vector<ColValueClause> where;
+ vector<ColValueClause> updates;
+
+ UpdateQuery(void);
+ QueryResult execute(map<string,Table> &tables);
+};
+
struct DeleteQuery : public Query{
- vector<WhereClause> where;
+ vector<ColValueClause> where;
DeleteQuery(void);
QueryResult execute(map<string,Table> &tables);