diff --git a/changelog.md b/changelog.md index 83cb1df6..99d05c08 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,11 @@ +Upcoming (TBD) +============== + +Documentation +--------- +* Document double-return requirement after `/fs` in multi-line mode. + + 2.10.0 (2026/08/05) ============== diff --git a/mycli/myclirc b/mycli/myclirc index e756d138..c6d0b14f 100644 --- a/mycli/myclirc +++ b/mycli/myclirc @@ -37,7 +37,8 @@ expand_dsn_alias_env_vars = False # Multi-line mode allows breaking up the sql statements into multiple lines. If # this is set to True, then the end of the statements must have a semi-colon. # If this is set to False then sql statements can't be split into multiple -# lines. End of line (return) is considered as the end of the statement. +# lines. End of line (Return) is considered as the end of the statement. +# When True, saving a favorite query requires pressing Return twice. multi_line = False # Destructive warning mode will alert you before executing a sql statement diff --git a/mycli/packages/special/favoritequeries.py b/mycli/packages/special/favoritequeries.py index ad480491..d0bfc4e8 100644 --- a/mycli/packages/special/favoritequeries.py +++ b/mycli/packages/special/favoritequeries.py @@ -75,14 +75,17 @@ class FavoriteQueries: Examples: # Save a new favorite query. - > /fs simple select * from abc where a is not Null; + > /fs simple SELECT * FROM abc WHERE a IS NOT NULL; + + # When multi-line mode is on, pressing Return twice is needed to save. + # This supports multi-statement favorites. # List all favorite queries. > /f ╒═══════════╤══════════════════════════════════════════════════╕ │ Name │ Query │ ╞═══════════╪══════════════════════════════════════════════════╡ - │ simple │ SELECT * FROM abc where a is not NULL │ + │ simple │ SELECT * FROM abc WHERE a IS NOT NULL │ │ find_user │ SELECT * FROM users WHERE name = '{{ kv.name }}' │ ╘═══════════╧══════════════════════════════════════════════════╛ @@ -94,15 +97,16 @@ class FavoriteQueries: │ 日本語 │ 日本語 │ ╘════════╧════════╛ - # Run a favorite query containing {{ kv.name }} in the template: + # Run a favorite query containing {{ kv.name }} in the template. > /f find_user --name=henry > /f find_user --name henry - # Run a favorite query containing $1 in the template: + # Run a favorite query containing positional parameter $1 in the + # template. > /f find_user henry - # Use -- to disambiguate positional parameters, especially if - # the positional value starts with a dash. + # Use -- to disambiguate positional parameters such as $1, especially + # if the positional value starts with a dash. > /f query --key=value -- positional-value > /f query -- --positional-value-which-looks-like-a-flag-- diff --git a/test/myclirc b/test/myclirc index a2a503b5..93e3606d 100644 --- a/test/myclirc +++ b/test/myclirc @@ -37,7 +37,8 @@ expand_dsn_alias_env_vars = False # Multi-line mode allows breaking up the sql statements into multiple lines. If # this is set to True, then the end of the statements must have a semi-colon. # If this is set to False then sql statements can't be split into multiple -# lines. End of line (return) is considered as the end of the statement. +# lines. End of line (Return) is considered as the end of the statement. +# When True, saving a favorite query requires pressing Return twice. multi_line = False # Destructive warning mode will alert you before executing a sql statement