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

Method extend_functions

mycli/sqlcompleter.py:1101–1123  ·  view source on GitHub ↗
(self, func_data: list[str] | Generator[tuple[str, str]], builtin: bool = False)

Source from the content-addressed store, hash-verified

1099 return conditions
1100
1101 def extend_functions(self, func_data: list[str] | Generator[tuple[str, str]], builtin: bool = False) -> None:
1102 # if 'builtin' is set this is extending the list of builtin functions
1103 if builtin:
1104 if isinstance(func_data, list):
1105 self.functions.extend(func_data)
1106 return
1107
1108 # 'func_data' is a generator object. It can throw an exception while
1109 # being consumed. This could happen if the user has launched the app
1110 # without specifying a database name. This exception must be handled to
1111 # prevent crashing.
1112 try:
1113 func_data_ll = [self.escaped_names(d) for d in func_data]
1114 except Exception:
1115 func_data_ll = []
1116
1117 # dbmetadata['functions'][$schema_name][$function_name] should return
1118 # function metadata.
1119 metadata = self.dbmetadata["functions"]
1120
1121 for func in func_data_ll:
1122 metadata[self.dbname][func[0]] = None
1123 self.all_completions.add(func[0])
1124
1125 def extend_procedures(self, procedure_data: Generator[tuple]) -> None:
1126 metadata = self.dbmetadata["procedures"]

Calls 2

escaped_namesMethod · 0.95
addMethod · 0.80