MCPcopy
hub / github.com/dbcli/pgcli / has_change_db_cmd

Function has_change_db_cmd

pgcli/main.py:1758–1767  ·  view source on GitHub ↗

Determines if the statement is a database switch such as 'use' or '\\c

(query)

Source from the content-addressed store, hash-verified

1756
1757
1758def has_change_db_cmd(query):
1759 """Determines if the statement is a database switch such as 'use' or '\\c'"""
1760 try:
1761 first_token = query.split()[0]
1762 if first_token.lower() in ("use", "\\c", "\\connect"):
1763 return True
1764 except Exception:
1765 return False
1766
1767 return False
1768
1769
1770def has_change_path_cmd(sql):

Callers 1

_evaluate_commandMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected