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)
==============

Documentation
---------
* Document the `\g` special command to send a query.


Internal
---------
* Independent case-sensitivity for special command aliases.
Expand Down
9 changes: 8 additions & 1 deletion mycli/packages/special/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def show_help(*_args) -> list[SQLResult]:
header = ["Command", "Shortcut", "Usage", "Description"]
result = []

for _, value in sorted(COMMANDS.items()):
for _, value in sorted(COMMANDS.items(), key=lambda x: str.casefold(x[0])):
if value.hidden:
continue
if value.aliases:
Expand Down Expand Up @@ -280,6 +280,13 @@ def quit_(*_args):
arg_type=ArgType.NO_QUERY,
case_sensitive=True,
)
@special_command(
"\\g",
"<query>\\g",
"Display query results (mnemonic: go).",
arg_type=ArgType.NO_QUERY,
case_sensitive=True,
)
def stub():
raise NotImplementedError

Expand Down
3 changes: 2 additions & 1 deletion test/features/fixture_data/help_commands.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
+----------------+----------+---------------------------------+-------------------------------------------------------------+
| Command | Shortcut | Usage | Description |
+----------------+----------+---------------------------------+-------------------------------------------------------------+
| \G | <null> | <query>\G | Display query results vertically. |
| \bug | <null> | \bug | File a bug on GitHub. |
| \clip | <null> | <query>\clip | Copy query to the system clipboard. |
| \dt | <null> | \dt[+] [table] | List or describe tables. |
| \edit | \e | <query>\edit | \edit <filename> | Edit query with editor (uses $VISUAL or $EDITOR). |
| \f | <null> | \f [name [args..]] | List or execute favorite queries. |
| \fd | <null> | \fd <name> | Delete a favorite query. |
| \fs | <null> | \fs <name> <query> | Save a favorite query. |
| \g | <null> | <query>\g | Display query results (mnemonic: go). |
| \G | <null> | <query>\G | Display query results vertically. |
| \l | <null> | \l | List databases. |
| \llm | \ai | \llm [arguments] | Interrogate an LLM. See "\llm help". |
| \once | \o | \once [-o] <filename> | Append next result to an output file (overwrite using -o). |
Expand Down