Skip to content

Highlight indexed columns in completion menus#2058

Merged
rolandwalker merged 1 commit into
mainfrom
RW/highlight-indexed-columns-in-completions
Jul 25, 2026
Merged

Highlight indexed columns in completion menus#2058
rolandwalker merged 1 commit into
mainfrom
RW/highlight-indexed-columns-in-completions

Conversation

@rolandwalker

Copy link
Copy Markdown
Contributor

Description

If a column is indexed, a configurable string is suffixed to it in the completion menu (asterisk by default). The suffix is display-only, and is not inserted when the completion is chosen.

Alternatively, a color or text style for indexed columns may be chosen using

[colors]
completion-menu.completion.indexed = <style>

which is not enabled by default.

For the purposes of the highlight, only the first column in a composite index is treated as indexed.

Motivation: the user does not need to separately check EXPLAIN or SHOW CREATE TABLE to know which columns will be best leveraged by a WHERE or JOIN.

Example:

highlight indexed columns

Checklist

  • I added this contribution to the changelog.md file.
  • I added my name to the AUTHORS file (or it's already there).
  • To lint and format the code, I ran
    uv run ruff check && uv run ruff format && uv run mypy --install-types .

If a column is indexed, a configurable string is suffixed to it in the
completion menu (asterisk by default).  The suffix is display-only, and
is not inserted when the completion is chosen.

Alternatively, a color or text style for indexed columns may be chosen
using

    [colors]
    completion-menu.completion.indexed = <style>

which is _not_ enabled by default.

For the purposes of the highlight, only the first column in a composite
index is treated as indexed.

Motivation: the user does not need to separately check EXPLAIN or
SHOW CREATE TABLE to know which columns will be best leveraged by a
WHERE or JOIN.
@rolandwalker rolandwalker self-assigned this Jul 25, 2026
@rolandwalker
rolandwalker merged commit 30a7740 into main Jul 25, 2026
11 checks passed
@rolandwalker
rolandwalker deleted the RW/highlight-indexed-columns-in-completions branch July 25, 2026 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant