IsQueryHandled parses the query string and determines if the query is handled by the proxy
(keyspace Identifier, query string)
| 160 | |
| 161 | // IsQueryHandled parses the query string and determines if the query is handled by the proxy |
| 162 | func IsQueryHandled(keyspace Identifier, query string) (handled bool, stmt Statement, err error) { |
| 163 | var l lexer |
| 164 | l.init(query) |
| 165 | |
| 166 | t := l.next() |
| 167 | switch t { |
| 168 | case tkSelect: |
| 169 | handled, stmt, err = isHandledSelectStmt(&l, keyspace) |
| 170 | if !handled { |
| 171 | stmt = defaultSelectStatement |
| 172 | } |
| 173 | return |
| 174 | case tkUse: |
| 175 | return isHandledUseStmt(&l) |
| 176 | } |
| 177 | return |
| 178 | } |
| 179 | |
| 180 | // IsQueryIdempotent parses the query string and determines if the query is idempotent |
| 181 | func IsQueryIdempotent(query string) (idempotent bool, err error) { |