Skip to content

Comments

Accept "socket" as a DSN query parameter#1594

Open
rolandwalker wants to merge 1 commit intomainfrom
RW/socket-dsn-query-parameter
Open

Accept "socket" as a DSN query parameter#1594
rolandwalker wants to merge 1 commit intomainfrom
RW/socket-dsn-query-parameter

Conversation

@rolandwalker
Copy link
Contributor

Description

socket as a query parameter instead of --socket as a CLI flag allows it to be saved in a DSN alias.

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 .

@rolandwalker rolandwalker self-assigned this Feb 21, 2026
@github-actions
Copy link

Findings
No correctness or security issues found in the change itself.

Test Gaps / Edge Cases

  1. CLI precedence: add a test that --socket overrides ?socket=... in the DSN to lock in the intended precedence behavior. This matters because socket = socket or params[0] relies on truthiness and could regress if defaults change. (mycli/main.py:1993, test/test_main.py:929)
  2. URL-encoded socket paths: add a test for a percent-encoded socket path (e.g., %2Ftmp%2Fmysql.sock) to ensure parsing stays correct across refactors that might change query parsing. (test/test_main.py:929)

If you want, I can add the tests.

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