MCPcopy Index your code
hub / github.com/dbcli/pgcli / query_starts_with

Function query_starts_with

pgcli/packages/parseutils/__init__.py:17–20  ·  view source on GitHub ↗

Check if the query starts with any item from *prefixes*.

(formatted_sql, prefixes)

Source from the content-addressed store, hash-verified

15
16
17def query_starts_with(formatted_sql, prefixes):
18 """Check if the query starts with any item from *prefixes*."""
19 prefixes = [prefix.lower() for prefix in prefixes]
20 return bool(formatted_sql) and formatted_sql.split()[0] in prefixes
21
22
23def query_is_unconditional_update(formatted_sql):

Callers 1

is_destructiveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected