Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mycli/sqlcompleter.py
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One additional thing I was going to add was escaping database names:

    def extend_database_names(self, databases: list[str]) -> None:
        self.databases.extend([self.escape_name(db) for db in databases])

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. Can we do that in a separate PR as its own feature?

Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/test_smart_completion_public_schema_only.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
Expand All @@ -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)]
Expand Down