(
self,
smart_completion: bool = True,
supported_formats: tuple = (),
keyword_casing: str = "auto",
)
| 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)): |
nothing calls this directly
no test coverage detected