Skip to content

Show the user in the prompt if a default user was used, instead of (none) - #2373

Merged
rolandwalker merged 1 commit into
mainfrom
RW/show-default-user-in-prompt
Oct 16, 2026
Merged

rolandwalker merged 1 commit into
mainfrom
RW/show-default-user-in-prompt

Conversation

@rolandwalker

Copy link
Copy Markdown
Contributor

Description

This is a complete fix for the bug which was papered over for Docker in 6e0d16a.

If a username was not given at the CLI with --user, and we fall back to a default user to make the connection, preserve the actual user for the connection in the SQLExecute instance.

Later, the prompt correctly fills in the \u username escape from the user property of the SQLExecute instance.

Storing the actual user instead of a None could be a help to other functionality beyond the prompt.

xref #2371

Checklist

  • I added this contribution to the changelog.md file.
  • I added my name to the mycli/AUTHORS.txt 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 .

instead of "(none)".

This is a complete fix for the bug which was papered over for Docker
in 6e0d16a.

If a username was not given at the CLI with --user, and we fall back
to a default user to make the connection, preserve the actual user for
the connection in the SQLExecute instance.

Later, the prompt correctly fills in the "\u" username escape from the
user property of the SQLExecute instance.

Storing the actual user instead of a None could be a help to other
functionality beyond the prompt.
@rolandwalker rolandwalker self-assigned this Oct 16, 2026
@rolandwalker
rolandwalker merged commit 939f597 into main Oct 16, 2026
13 checks passed
@rolandwalker
rolandwalker deleted the RW/show-default-user-in-prompt branch October 16, 2026 10:31
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