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

Function is_subselect

mycli/packages/sql_utils.py:83–89  ·  view source on GitHub ↗
(parsed: TokenList)

Source from the content-addressed store, hash-verified

81# This code is borrowed from sqlparse example script.
82# <url>
83def is_subselect(parsed: TokenList) -> bool:
84 if not parsed.is_group:
85 return False
86 for item in parsed.tokens:
87 if item.ttype is DML and item.value.upper() in ("SELECT", "INSERT", "UPDATE", "CREATE", "DELETE"):
88 return True
89 return False
90
91
92def get_last_select(parsed: TokenList) -> TokenList:

Calls

no outgoing calls