diff options
Diffstat (limited to 'query.h')
-rw-r--r-- | query.h | 41 |
1 files changed, 41 insertions, 0 deletions
@@ -0,0 +1,41 @@ +#pragma once + +#include "enginedata.h" +#include <vector> +#include <string> +#include <map> + +using namespace std; + + +struct WhereClause{ + int col; + RowItem value; + WhereClause(void); + WhereClause(const int _c,const RowItem &_v); +}; + + +struct QueryResult{ + int res; + vector<Row> rows; + QueryResult(void); + QueryResult(int); + QueryResult(int,const vector<Row>&); +}; + + +struct Query{ + string from; + int limit; //-1=unlimited + Query(void); + virtual QueryResult execute(const map<string,Table>&); +}; + +struct FindQuery : public Query{ + int sort; //0=no sort, 1=sort, -1=reverse sort + vector<WhereClause> where; + FindQuery(void); + QueryResult execute(const map<string,Table>&); +}; + |