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

Method __init__

mycli/sqlcompleter.py:935–953  ·  view source on GitHub ↗
(
        self,
        smart_completion: bool = True,
        supported_formats: tuple = (),
        keyword_casing: str = "auto",
    )

Source from the content-addressed store, hash-verified

933 collations: list[str] = []
934
935 def __init__(
936 self,
937 smart_completion: bool = True,
938 supported_formats: tuple = (),
939 keyword_casing: str = "auto",
940 ) -> None:
941 super(self.__class__, self).__init__()
942 self.smart_completion = smart_completion
943 self.reserved_words = set()
944 for x in self.keywords:
945 self.reserved_words.update(x.split())
946 self.name_pattern = re.compile(r"^[_a-zA-Z][_a-zA-Z0-9\$]*$")
947
948 self.special_commands: list[str] = []
949 self.table_formats = supported_formats
950 if keyword_casing not in ("upper", "lower", "auto"):
951 keyword_casing = "auto"
952 self.keyword_casing = keyword_casing
953 self.reset_completions()
954
955 def escape_name(self, name: str) -> str:
956 if name and ((not self.name_pattern.match(name)) or (name.upper() in self.reserved_words) or (name.upper() in self.functions)):

Callers

nothing calls this directly

Calls 2

reset_completionsMethod · 0.95
splitMethod · 0.80

Tested by

no test coverage detected