diff --git a/changelog.md b/changelog.md index d8beb865..085c8075 100644 --- a/changelog.md +++ b/changelog.md @@ -6,6 +6,7 @@ Features * Add `--unbuffered` mode which fetches rows as needed, to save memory. * Default to standards-compliant `utf8mb4` character set. * Stream input from STDIN to consume less memory, adding `--noninteractive` and `--format=` CLI arguments. +* Remove suggested quoting on completions for identifiers with uppercase. Bug Fixes diff --git a/mycli/sqlcompleter.py b/mycli/sqlcompleter.py index e27fcfa6..e765a815 100644 --- a/mycli/sqlcompleter.py +++ b/mycli/sqlcompleter.py @@ -782,7 +782,7 @@ def __init__( self.reserved_words = set() for x in self.keywords: self.reserved_words.update(x.split()) - self.name_pattern = re.compile(r"^[_a-z][_a-z0-9\$]*$") + self.name_pattern = re.compile(r"^[_a-zA-Z][_a-zA-Z0-9\$]*$") self.special_commands: list[str] = [] self.table_formats = supported_formats diff --git a/test/test_smart_completion_public_schema_only.py b/test/test_smart_completion_public_schema_only.py index f841db49..0d1ed11a 100644 --- a/test/test_smart_completion_public_schema_only.py +++ b/test/test_smart_completion_public_schema_only.py @@ -433,7 +433,7 @@ def test_auto_escaped_col_names(completer, complete_event): Completion(text="*", start_position=0), Completion(text="id", start_position=0), Completion(text="`insert`", start_position=0), - Completion(text="`ABC`", start_position=0), + Completion(text="ABC", start_position=0), ] + list(map(Completion, completer.functions)) + [Completion(text="select", start_position=0)] + list( map(Completion, completer.keywords) ) @@ -448,7 +448,7 @@ def test_un_escaped_table_names(completer, complete_event): Completion(text="*", start_position=0), Completion(text="id", start_position=0), Completion(text="`insert`", start_position=0), - Completion(text="`ABC`", start_position=0), + Completion(text="ABC", start_position=0), ] + list(map(Completion, completer.functions)) + [Completion(text="réveillé", start_position=0)]