Skip to content

Commit 7c2ee7d

Browse files
committed
remove quoting on uppercase-identifier completions
Mandatory quoting is retained for identifiers which have any non-alphanumeric characters, but an uppercase character alone does not activate the suggested quoting.
1 parent 90c81b3 commit 7c2ee7d

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
TBD
22
==============
33

4+
Features
5+
--------
6+
* Remove suggested quoting on completions for identifiers with uppercase.
7+
8+
49
Bug Fixes
510
--------
611
* Fix CamelCase fuzzy matching.

mycli/sqlcompleter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ def __init__(
777777
self.reserved_words = set()
778778
for x in self.keywords:
779779
self.reserved_words.update(x.split())
780-
self.name_pattern = re.compile(r"^[_a-z][_a-z0-9\$]*$")
780+
self.name_pattern = re.compile(r"^[_a-zA-Z][_a-zA-Z0-9\$]*$")
781781

782782
self.special_commands: list[str] = []
783783
self.table_formats = supported_formats

test/test_smart_completion_public_schema_only.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ def test_auto_escaped_col_names(completer, complete_event):
433433
Completion(text="*", start_position=0),
434434
Completion(text="id", start_position=0),
435435
Completion(text="`insert`", start_position=0),
436-
Completion(text="`ABC`", start_position=0),
436+
Completion(text="ABC", start_position=0),
437437
] + list(map(Completion, completer.functions)) + [Completion(text="select", start_position=0)] + list(
438438
map(Completion, completer.keywords)
439439
)
@@ -448,7 +448,7 @@ def test_un_escaped_table_names(completer, complete_event):
448448
Completion(text="*", start_position=0),
449449
Completion(text="id", start_position=0),
450450
Completion(text="`insert`", start_position=0),
451-
Completion(text="`ABC`", start_position=0),
451+
Completion(text="ABC", start_position=0),
452452
]
453453
+ list(map(Completion, completer.functions))
454454
+ [Completion(text="réveillé", start_position=0)]

0 commit comments

Comments
 (0)