MCPcopy Create free account
hub / github.com/datastax/cql-proxy / IsQueryHandled

Function IsQueryHandled

parser/parser.go:162–178  ·  view source on GitHub ↗

IsQueryHandled parses the query string and determines if the query is handled by the proxy

(keyspace Identifier, query string)

Source from the content-addressed store, hash-verified

160
161// IsQueryHandled parses the query string and determines if the query is handled by the proxy
162func 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
181func IsQueryIdempotent(query string) (idempotent bool, err error) {

Callers 7

benchmarkIsQueryHandledFunction · 0.92
handlePrepareMethod · 0.92
handleQueryMethod · 0.92
InterceptQueryMethod · 0.92
TestParserFunction · 0.85

Calls 4

initMethod · 0.95
nextMethod · 0.95
isHandledSelectStmtFunction · 0.85
isHandledUseStmtFunction · 0.85

Tested by 3

TestParserFunction · 0.68