Skip to content
Merged
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 @@ -9,6 +9,7 @@ Features
Bug Fixes
--------
* Fix timediff output when the result is a negative value (#1113).
* Don't offer completions for numeric text.


1.46.0 (2026/01/22)
Expand Down
5 changes: 4 additions & 1 deletion mycli/sqlcompleter.py
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,10 @@ def find_matches(
# unicode support not possible without adding the regex dependency
case_change_pat = re.compile("(?<=[a-z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])")

completions = []
completions: list[str] = []

if re.match(r'^[\d\.]', text):
return (Completion(x, -len(text)) for x in completions)

if fuzzy:
regex = ".{0,3}?".join(map(re.escape, text))
Expand Down
7 changes: 7 additions & 0 deletions test/test_smart_completion_public_schema_only.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,13 @@ def test_deleted_keyword_completion(completer, complete_event):
]


def test_numbers_no_completion(completer, complete_event):
text = "SELECT COUNT(1) FROM time_zone WHERE Time_zone_id = 1"
position = len("SELECT COUNT(1) FROM time_zone WHERE Time_zone_id = 1")
result = list(completer.get_completions(Document(text=text, cursor_position=position), complete_event))
assert result == [] # ie not INT1


def dummy_list_path(dir_name):
dirs = {
"/": [
Expand Down