diff options
author | tomsmeding <hallo@tomsmeding.nl> | 2015-05-22 21:13:51 +0200 |
---|---|---|
committer | tomsmeding <hallo@tomsmeding.nl> | 2015-05-22 21:13:51 +0200 |
commit | 059a8baa815f0b50d11546ad26b854572ef52182 (patch) | |
tree | 87009b91f388e7a6603c6c409941e371b22d35d3 /query.h | |
parent | 675e8972384e808f2b622922df5e8deef418e165 (diff) |
CreateQuery, InsertQuery, add message in QueryResult
Diffstat (limited to 'query.h')
-rw-r--r-- | query.h | 27 |
1 files changed, 22 insertions, 5 deletions
@@ -19,23 +19,40 @@ struct WhereClause{ struct QueryResult{ int res; vector<Row> rows; + string msg; //empty message indicates success QueryResult(void); QueryResult(int); QueryResult(int,const vector<Row>&); + QueryResult(int,const vector<Row>&,const string&); + QueryResult(int,const string&); }; struct Query{ - string from; - int limit; //-1=unlimited - Query(void); - virtual QueryResult execute(const map<string,Table>&); + string tablename; + virtual QueryResult execute(map<string,Table>&); +}; + +struct CreateQuery : public Query{ + int nc; + ColHeader *header; + CreateQuery(void); + void setHeader(const ColHeader *hd); + QueryResult execute(map<string,Table> &tables); }; struct FindQuery : public Query{ + unsigned int limit; //-1=unlimited int sort; //0=no sort, 1=sort, -1=reverse sort vector<WhereClause> where; FindQuery(void); - QueryResult execute(const map<string,Table>&); + QueryResult execute(map<string,Table> &tables); +}; + +struct InsertQuery : public Query{ + Row row; + InsertQuery(const Row &_r); + InsertQuery(Row &&_r); + QueryResult execute(map<string,Table> &tables); }; |