diff options
Diffstat (limited to 'lib/statement.h')
| -rw-r--r-- | lib/statement.h | 9 |
1 files changed, 6 insertions, 3 deletions
| diff --git a/lib/statement.h b/lib/statement.h index 15c4ac3..2fadf05 100644 --- a/lib/statement.h +++ b/lib/statement.h | |||
| @@ -140,7 +140,7 @@ namespace verbly { | |||
| 140 | 140 | ||
| 141 | condition(std::string table, std::string column, bool isNull); | 141 | condition(std::string table, std::string column, bool isNull); |
| 142 | 142 | ||
| 143 | condition(std::string table, std::string column, comparison comp, binding value); | 143 | condition(std::string table, std::string column, comparison comp, binding value, object parentObject = object::undefined); |
| 144 | 144 | ||
| 145 | // Group | 145 | // Group |
| 146 | 146 | ||
| @@ -160,6 +160,8 @@ namespace verbly { | |||
| 160 | 160 | ||
| 161 | condition flatten() const; | 161 | condition flatten() const; |
| 162 | 162 | ||
| 163 | condition resolveCompareFields(object context, std::string tableName) const; | ||
| 164 | |||
| 163 | private: | 165 | private: |
| 164 | union { | 166 | union { |
| 165 | struct { | 167 | struct { |
| @@ -167,6 +169,7 @@ namespace verbly { | |||
| 167 | std::string column_; | 169 | std::string column_; |
| 168 | comparison comparison_; | 170 | comparison comparison_; |
| 169 | binding value_; | 171 | binding value_; |
| 172 | object parentObject_; | ||
| 170 | } singleton_; | 173 | } singleton_; |
| 171 | struct { | 174 | struct { |
| 172 | std::list<condition> children_; | 175 | std::list<condition> children_; |
| @@ -251,7 +254,6 @@ namespace verbly { | |||
| 251 | : (context == object::word) ? "words" | 254 | : (context == object::word) ? "words" |
| 252 | : (context == object::frame) ? "frames" | 255 | : (context == object::frame) ? "frames" |
| 253 | : (context == object::part) ? "parts" | 256 | : (context == object::part) ? "parts" |
| 254 | : (context == object::lemma) ? "lemmas_forms" | ||
| 255 | : (context == object::form) ? "forms" | 257 | : (context == object::form) ? "forms" |
| 256 | : (context == object::pronunciation) ? "pronunciations" | 258 | : (context == object::pronunciation) ? "pronunciations" |
| 257 | : throw std::domain_error("Provided context has no associated table"); | 259 | : throw std::domain_error("Provided context has no associated table"); |
| @@ -259,7 +261,7 @@ namespace verbly { | |||
| 259 | 261 | ||
| 260 | static const std::list<field> getSelectForContext(object context); | 262 | static const std::list<field> getSelectForContext(object context); |
| 261 | 263 | ||
| 262 | statement(std::string tableName, filter clause, int nextTableId = 0, int nextWithId = 0); | 264 | statement(object context, std::string tableName, filter clause, int nextTableId = 0, int nextWithId = 0); |
| 263 | 265 | ||
| 264 | condition parseFilter(filter queryFilter); | 266 | condition parseFilter(filter queryFilter); |
| 265 | 267 | ||
| @@ -272,6 +274,7 @@ namespace verbly { | |||
| 272 | int nextTableId_; | 274 | int nextTableId_; |
| 273 | int nextWithId_; | 275 | int nextWithId_; |
| 274 | 276 | ||
| 277 | object context_; | ||
| 275 | std::map<std::string, std::string> tables_; | 278 | std::map<std::string, std::string> tables_; |
| 276 | std::string topTable_; | 279 | std::string topTable_; |
| 277 | std::list<join> joins_; | 280 | std::list<join> joins_; |
