Skip to content

Conversation

@rolandwalker
Copy link
Contributor

@rolandwalker rolandwalker commented Jan 30, 2026

Description

It would seem that there was a regression in #1436, and we need to redo #1291.

In order to do this, we have to lose some special DSN logic. There is just no way under the current setup, since for instance the SSL params get parsed out of the DSN before calling connect().

Once solution could be to do all configuration parsing early, a long-term goal.

Here we replace the DSN fallthrough with a warning message.

The password_from_file logic is incidentally improved.

Checklist

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

@rolandwalker rolandwalker self-assigned this Jan 30, 2026
@scottnemes
Copy link
Contributor

I removed it on purpose because when prompting the user for a password at the start, the username is not yet known unless the --user/-u option is passed. So you'd have to move the config checks up higher, or it just shows None. But if that's what you want, then works as-is then anyway.

uv run mycli --password
Enter password for None:

uv run mycli -u scottn --password
Enter password for scottn:

user = user or cnf["user"] or os.getenv("USER")

@rolandwalker
Copy link
Contributor Author

I see. We don't have cnf yet.

@rolandwalker rolandwalker force-pushed the RW/show-user-in-password-prompt branch 2 times, most recently from cd5ca0b to e77def3 Compare January 31, 2026 21:12
In order to do this, we have to lose some special DSN logic.  There is
just no way under the current setup, since for instance the SSL params
get parsed out of the DSN before calling connect().

Once solution could be to do all configuration parsing early, a long-
term goal.

Here we replace the DSN fallthrough with a warning message.

The password_from_file logic is incidentally improved.
@rolandwalker rolandwalker force-pushed the RW/show-user-in-password-prompt branch from e77def3 to 5a07d42 Compare January 31, 2026 21:13
@scottnemes
Copy link
Contributor

scottnemes commented Feb 2, 2026

@rolandwalker Apologies for the back and forth on this. After working for a while to try and re-add the original password related functionality back into your change (while keeping the user in the prompt), I realized it could be done in a much simpler way (as far as I can tell anyway). I created a new PR with what I believe works, and included your updated password file logic. I believe that was the only other thing that you added (other than the import re-organization, I added that as well). But if I missed something let me know:

#1502

@rolandwalker
Copy link
Contributor Author

Closing in favor of #1502 .

@rolandwalker rolandwalker deleted the RW/show-user-in-password-prompt branch February 2, 2026 09:52
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.

3 participants