Skip to content

Migrate connection-related settings from myclirc [main]#1963

Merged
rolandwalker merged 1 commit into
mainfrom
RW/deprecate-main-section-connection-settings
Jun 24, 2026
Merged

Migrate connection-related settings from myclirc [main]#1963
rolandwalker merged 1 commit into
mainfrom
RW/deprecate-main-section-connection-settings

Conversation

@rolandwalker

@rolandwalker rolandwalker commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Description

  • migrate main.default_character_set to the [connection] section if present
  • migrate main.ssl_mode to connection.default_ssl_mode if present

These migrations will affect a modest number of users who installed mycli for the first time during the periods in which the given connection-level settings were in [main] in the default myclirc file.

For default_ssl_mode, that is fresh installs between 2026-01-02 and 2026-02-09. For default_character_set, that is fresh installs between 2026-01-22 and 2026-02-02.

Users who ran mycli --checkup since then were already advised to migrate the settings to the [connection] section.

The --checkup instructions for migrating the settings are not removed, though they are somewhat duplicative, to keep the checkup instructions more coherent.

Writes to the config file should probably be used sparingly, since some comments and formatting in the user's file can be lost, but this already happens if a favorite query is saved.

Motivation: general simplification; bundling all breaking changes into the 2.0 release. The logic for determining whether the user or package configuration controls is too subtle when there are multiple possible locations for the setting.

Preparation for release 2.0

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 Jun 23, 2026
@rolandwalker rolandwalker force-pushed the RW/deprecate-main-section-connection-settings branch from e7bc88f to 17fd14c Compare June 23, 2026 16:40
@rolandwalker rolandwalker changed the title Deprecate connection-level settings in myclirc [main] Migrate connection settings from myclirc [main] Jun 23, 2026
@rolandwalker rolandwalker force-pushed the RW/deprecate-main-section-connection-settings branch from 17fd14c to a5a14b3 Compare June 23, 2026 16:50
@rolandwalker rolandwalker changed the title Migrate connection settings from myclirc [main] Migrate connection-related settings from myclirc [main] Jun 23, 2026
Comment thread mycli/app_state.py Outdated
del config_without_package_defaults['main']['ssl_mode']
config_without_package_defaults.write()

if ssl_mode is None and 'default_ssl_mode' in config['connection']:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think this should be if not ssl_mode, or more checks needed. Previously it used .get for the ssl_mode so it would be None if not set/empty, but with the new code it could end up being an empty string which would pass the ssl_mode is None check.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed!

@scottnemes scottnemes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left one comment. Good to go after that or if you decide not to change it

 * migrate main.default_character_set to the [connection] section if
   present
 * migrate main.ssl_mode to connection.default_ssl_mode if present

These migrations will affect a modest number of users who installed
mycli for the first time during the periods in which the given
connection-level settings were in [main] in the default myclirc
file.

For default_ssl_mode, that is fresh installs between 2026-01-02 and
2026-02-09.  For default_character_set, that is fresh installs between
2026-01-22 and 2026-02-02.

Users who ran "mycli --checkup" since then were already advised to
migrate the settings to the [connection] section.

The --checkup instructions for migrating the settings are not removed,
though they are somewhat duplicative, to keep the checkup instructions
more coherent.

Writes to the config file should probably be used sparingly, since some
comments and formatting in the user's file can be lost, but this already
happens if a favorite query is saved.

Motivation: general simplification; bundling all breaking changes into
the 2.0 release.  The logic for determining whether the user or package
configuration controls is too subtle when there are multiple possible
locations for the setting.

Preparation for release 2.0
@rolandwalker rolandwalker force-pushed the RW/deprecate-main-section-connection-settings branch from a5a14b3 to 1948b26 Compare June 24, 2026 09:59
@rolandwalker rolandwalker merged commit 0d896ab into main Jun 24, 2026
11 checks passed
@rolandwalker rolandwalker deleted the RW/deprecate-main-section-connection-settings branch June 24, 2026 10:06
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.

2 participants