Repository navigation
Allow unquoted comma-containing favorite queries to be saved in ~/.myclirc - #2340
Merged
rolandwalker merged 1 commit intoOct 7, 2026
Merged
Conversation
Contributor
Author
|
This is more complex than I'd like it to be. It could be simpler to just entirely turn off |
to be saved in ~/.myclirc. ConfigObj returns a list when it sees a comma, so mycli was capable of saving an item it could not read back on restart. The fix is for values in the favorite_queries stanza to be treated differently, and never to be read in as a list. Favorite queries are all triple-quoted on save, and there is an on-the-fly hack to the reader to triple-quote any favorite from past saves which are not triple-quoted. There could be other stanzas of the config file which should have the same treatment. Shipping this with one minor limitation noted in comments: saving SQL with _both_ possible triple-quote delimiters as values internal to the SQL text is not possible.
rolandwalker
force-pushed
the
RW/allow-unquoted-comma-containing-favorite-queries
branch
from
October 7, 2026 16:32
256fd70 to
4c219d8
Compare
rolandwalker
deleted the
RW/allow-unquoted-comma-containing-favorite-queries
branch
October 7, 2026 16:38
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
ConfigObjreturns a list when it sees a comma, so mycli was capable of saving an item it could not read back on restart.The fix is for values in the
favorite_queriesstanza to be treated differently, and never to be read in as a list.Favorite queries are all triple-quoted on save, and there is an on-the-fly hack to the reader to triple-quote any favorite from past saves which are not triple-quoted.
There could be other stanzas of the config file which should have the same treatment.
Shipping this with one minor limitation noted in comments: saving SQL with both possible triple-quote delimiters as values internal to the SQL text is not possible.
Fixes #2339
Checklist
changelog.mdfile.mycli/AUTHORS.txtfile (or it's already there).