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
4 changes: 4 additions & 0 deletions changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ Features:
reflects the current editing mode: beam in INSERT, block in NORMAL, underline in REPLACE.
Uses prompt_toolkit's ``ModalCursorShapeConfig``.

Bug fixes:
----------
* Add `VERSION` to built-in function completion so `SELECT VERSION();` is suggested.

4.4.0 (2025-12-24)
==================

Expand Down
1 change: 1 addition & 0 deletions pgcli/packages/pgliterals/pgliterals.json
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@
"TRUNC",
"UNNEST",
"UPPER",
"VERSION",
"WIDTH",
"WIDTH_BUCKET",
"XMLAGG"
Expand Down
7 changes: 7 additions & 0 deletions tests/test_naive_completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ def test_function_name_completion(completer, complete_event):
])


def test_version_function_name_completion(completer, complete_event):
text = "SELECT VE"
position = len(text)
result = completions_to_set(completer.get_completions(Document(text=text, cursor_position=position), complete_event))
assert result == completions_to_set([Completion(text="VERSION", start_position=-2)])


def test_column_name_completion(completer, complete_event):
text = "SELECT FROM users"
position = len("SELECT ")
Expand Down
6 changes: 6 additions & 0 deletions tests/test_smart_completion_public_schema_only.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,12 @@ def test_builtin_function_name_completion(completer):
])


@parametrize("completer", completers())
def test_builtin_version_function_completion(completer):
result = get_result(completer, "SELECT VE")
assert completions_to_set(result) == completions_to_set([function("VERSION", -2)])


@parametrize("completer", completers())
def test_builtin_function_matches_only_at_start(completer):
text = "SELECT IN"
Expand Down
Loading