Skip to content
Merged
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
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Internal
---------
* Use prompt_toolkit's `bell()`.
* Refactor `SQLResult` dataclass.
* Avoid depending on string matches into host info.


1.58.0 (2026/02/28)
Expand Down
8 changes: 4 additions & 4 deletions mycli/packages/special/dbcommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def status(cur: Cursor, **_) -> list[SQLResult]:
output.append(("Protocol version:", variables["protocol_version"]))
output.append(('SSL/TLS version:', get_ssl_version(cur)))

if getattr(cur.connection, 'unix_socket', None) is not None:
if getattr(cur.connection, 'unix_socket', None):
host_info = cur.connection.host_info
else:
host_info = f'{cur.connection.host} via TCP/IP'
Expand All @@ -147,10 +147,10 @@ def status(cur: Cursor, **_) -> list[SQLResult]:
output.append(("Client characterset:", charset[2]))
output.append(("Conn. characterset:", charset[3]))

if "TCP/IP" in host_info:
output.append(("TCP port:", cur.connection.port))
if getattr(cur.connection, 'unix_socket', None):
output.append(('UNIX socket:', variables['socket']))
else:
output.append(("UNIX socket:", variables["socket"]))
output.append(('TCP port:', cur.connection.port))

if "Uptime" in status:
output.append(("Uptime:", format_uptime(status["Uptime"])))
Expand Down