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

Function query_is_unconditional_update

pgcli/packages/parseutils/__init__.py:23–26  ·  view source on GitHub ↗

Check if the query starts with UPDATE and contains no WHERE.

(formatted_sql)

Source from the content-addressed store, hash-verified

21
22
23def query_is_unconditional_update(formatted_sql):
24 """Check if the query starts with UPDATE and contains no WHERE."""
25 tokens = formatted_sql.split()
26 return bool(tokens) and tokens[0] == "update" and "where" not in tokens
27
28
29def is_destructive(queries, keywords):

Callers 1

is_destructiveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected