MCPcopy Index your code
hub / github.com/dbcli/mycli / queries_start_with

Function queries_start_with

mycli/packages/sql_utils.py:348–353  ·  view source on GitHub ↗

Check if any queries start with any item from *prefixes*.

(queries: str, prefixes: list[str])

Source from the content-addressed store, hash-verified

346
347
348def queries_start_with(queries: str, prefixes: list[str]) -> bool:
349 """Check if any queries start with any item from *prefixes*."""
350 for query in sqlparse.split(queries):
351 if query and query_starts_with(query, prefixes) is True:
352 return True
353 return False
354
355
356def query_has_where_clause(query: str) -> bool:

Callers 1

test_queries_start_withFunction · 0.90

Calls 2

query_starts_withFunction · 0.85
splitMethod · 0.80

Tested by 1

test_queries_start_withFunction · 0.72