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
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Upcoming (TBD)
==============

Breaking Changes
---------
* Remove undocumented support for `tcp://` and `socket://` DSNs.


Documentation
---------
* Fix a typo in myclirc commentary.
Expand Down
8 changes: 2 additions & 6 deletions mycli/packages/cli_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ def is_valid_connection_scheme(text: str) -> tuple[bool, str | None]:
# exit early if the text does not resemble a DSN URI
if "://" not in text:
return False, None
scheme = text.split("://")[0]
if scheme.startswith('mysql+'):
return True, None
if scheme.startswith('mysqlx+'):
return True, None
if scheme in ("mysql", "mysqlx", "tcp", "socket"):
scheme = text.split("://")[0].split("+")[0]
if scheme in ("mysql", "mysqlx"):
return True, None
return False, scheme
4 changes: 2 additions & 2 deletions test/pytests/test_cli_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ def test_filtered_sys_argv_appends_empty_password_sentinel(monkeypatch, password
('mysql+pymysql://user@localhost/db', True, None),
('mysqlx://user@localhost/db', True, None),
('mysqlx+pymysql://user@localhost/db', True, None),
('tcp://localhost:3306', True, None),
('socket:///tmp/mysql.sock', True, None),
('tcp://localhost:3306', False, 'tcp'),
('socket:///tmp/mysql.sock', False, 'socket'),
('ssh://user@example.com', False, 'ssh'),
('postgres://user@localhost/db', False, 'postgres'),
('http://example.com', False, 'http'),
Expand Down
Loading