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

Function is_valid_connection_scheme

mycli/packages/cli_utils.py:22–33  ·  view source on GitHub ↗
(text: str)

Source from the content-addressed store, hash-verified

20
21
22def is_valid_connection_scheme(text: str) -> tuple[bool, str | None]:
23 # exit early if the text does not resemble a DSN URI
24 if "://" not in text:
25 return False, None
26 scheme = text.split("://")[0]
27 if scheme.startswith('mysql+'):
28 return True, None
29 if scheme.startswith('mysqlx+'):
30 return True, None
31 if scheme in ("mysql", "mysqlx", "tcp", "socket"):
32 return True, None
33 return False, scheme

Callers 3

run_from_cli_argsFunction · 0.90
preprocess_cli_argsFunction · 0.85

Calls 1

splitMethod · 0.80

Tested by 1