Skip to content
Open
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
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Breaking Changes
Features
---------
* Add `--warn-batch` flag, which is off by default.
* Advertise forward-slash `/command` forms in `/help` output.


Bug Fixes
Expand Down
14 changes: 7 additions & 7 deletions mycli/client_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,53 +35,53 @@ def register_special_commands(self) -> None:
special.register_special_command(
self.change_db,
"use",
"use <database>",
"/use <database>",
"Change to a new database.",
aliases=[SpecialCommandAlias("\\u", case_sensitive=False)],
)
special.register_special_command(
self.manual_reconnect,
"connect",
"connect [database]",
"/connect [database]",
"Reconnect to the server, optionally switching databases.",
case_sensitive=True,
aliases=[SpecialCommandAlias("\\r", case_sensitive=True)],
)
special.register_special_command(
self.refresh_completions,
"rehash",
"rehash",
"/rehash",
"Refresh auto-completions.",
arg_type=ArgType.NO_QUERY,
aliases=[SpecialCommandAlias("\\#", case_sensitive=False)],
)
special.register_special_command(
self.change_table_format,
"tableformat",
"tableformat <format>",
"/tableformat <format>",
"Change the table format used to output interactive results.",
case_sensitive=True,
aliases=[SpecialCommandAlias("\\T", case_sensitive=True)],
)
special.register_special_command(
self.change_redirect_format,
"redirectformat",
"redirectformat <format>",
"/redirectformat <format>",
"Change the table format used to output redirected results.",
case_sensitive=True,
aliases=[SpecialCommandAlias("\\Tr", case_sensitive=True)],
)
special.register_special_command(
self.execute_from_file,
"source",
"source <filename>",
"/source <filename>",
"Execute queries from a file.",
aliases=[SpecialCommandAlias("\\.", case_sensitive=False)],
)
special.register_special_command(
self.change_prompt_format,
"prompt",
"prompt <string>",
"/prompt <string>",
"Change prompt format.",
case_sensitive=True,
aliases=[SpecialCommandAlias("\\R", case_sensitive=True)],
Expand Down
6 changes: 3 additions & 3 deletions mycli/packages/special/dbcommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

@special_command(
"\\dt",
"\\dt[+] [table]",
"/dt[+] [table]",
"List or describe tables.",
arg_type=ArgType.PARSED_QUERY,
case_sensitive=True,
Expand Down Expand Up @@ -61,7 +61,7 @@ def list_tables(

@special_command(
"\\l",
"\\l",
"/l",
"List databases.",
arg_type=ArgType.RAW_QUERY,
case_sensitive=True,
Expand All @@ -80,7 +80,7 @@ def list_databases(cur: Cursor, **_) -> list[SQLResult]:

@special_command(
"status",
"status",
"/status",
"Get status information from the server.",
arg_type=ArgType.RAW_QUERY,
case_sensitive=True,
Expand Down
30 changes: 15 additions & 15 deletions mycli/packages/special/iocommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def is_show_warnings_enabled() -> bool:

@special_command(
'warnings',
'warnings',
'/warnings',
'Enable automatic warnings display.',
arg_type=ArgType.NO_QUERY,
case_sensitive=True,
Expand All @@ -108,7 +108,7 @@ def enable_show_warnings() -> Generator[SQLResult, None, None]:

@special_command(
'nowarnings',
'nowarnings',
'/nowarnings',
'Disable automatic warnings display.',
arg_type=ArgType.NO_QUERY,
case_sensitive=True,
Expand All @@ -123,7 +123,7 @@ def disable_show_warnings() -> Generator[SQLResult, None, None]:

@special_command(
"pager",
"pager [command]",
"/pager [command]",
"Set pager to [command]. Print query results via pager.",
arg_type=ArgType.PARSED_QUERY,
case_sensitive=True,
Expand All @@ -147,7 +147,7 @@ def set_pager(arg: str, **_) -> list[SQLResult]:

@special_command(
"nopager",
"nopager",
"/nopager",
"Disable pager; print to stdout.",
arg_type=ArgType.NO_QUERY,
case_sensitive=True,
Expand All @@ -160,7 +160,7 @@ def disable_pager() -> list[SQLResult]:

@special_command(
"\\timing",
"\\timing",
"/timing",
"Toggle timing of queries.",
arg_type=ArgType.NO_QUERY,
case_sensitive=True,
Expand Down Expand Up @@ -327,7 +327,7 @@ def set_redirect(command_part: str | None, file_operator_part: str | None, file_

@special_command(
"\\f",
"\\f [name [args..]]",
"/f [name [args..]]",
"List or execute favorite queries.",
arg_type=ArgType.PARSED_QUERY,
case_sensitive=True,
Expand Down Expand Up @@ -403,7 +403,7 @@ def subst_favorite_query_args(query: str, args: list[str]) -> list[str | None]:

@special_command(
"\\fs",
"\\fs <name> <query>",
"/fs <name> <query>",
"Save a favorite query.",
)
def save_favorite_query(arg: str, **_) -> list[SQLResult]:
Expand All @@ -425,7 +425,7 @@ def save_favorite_query(arg: str, **_) -> list[SQLResult]:

@special_command(
"\\fd",
"\\fd <name>",
"/fd <name>",
"Delete a favorite query.",
)
def delete_favorite_query(arg: str, **_) -> list[SQLResult]:
Expand All @@ -441,7 +441,7 @@ def delete_favorite_query(arg: str, **_) -> list[SQLResult]:

@special_command(
"system",
"system [-r] <command>",
"/system [-r] <command>",
"Execute a system shell command (raw mode with -r).",
)
def execute_system_command(arg: str, **_) -> list[SQLResult]:
Expand Down Expand Up @@ -522,7 +522,7 @@ def parseargfile(arg: str) -> tuple[str, str]:

@special_command(
"tee",
"tee [-o] <filename>",
"/tee [-o] <filename>",
"Append all results to an output file (overwrite using -o).",
)
def set_tee(arg: str, **_) -> list[SQLResult]:
Expand All @@ -545,7 +545,7 @@ def close_tee() -> None:

@special_command(
"notee",
"notee",
"/notee",
"Stop writing results to an output file.",
)
def no_tee(arg: str, **_) -> list[SQLResult]:
Expand All @@ -565,7 +565,7 @@ def write_tee(output: str | ANSI | FormattedText, nl: bool = True) -> None:

@special_command(
"\\once",
"\\once [-o] <filename>",
"/once [-o] <filename>",
"Append next result to an output file (overwrite using -o).",
aliases=[SpecialCommandAlias("\\o", case_sensitive=False)],
)
Expand Down Expand Up @@ -623,7 +623,7 @@ def _run_post_redirect_hook(post_redirect_command: str, filename: str) -> None:

@special_command(
"\\pipe_once",
"\\pipe_once <command>",
"/pipe_once <command>",
"Send next result to a subprocess.",
aliases=[SpecialCommandAlias("\\|", case_sensitive=False)],
)
Expand Down Expand Up @@ -687,7 +687,7 @@ def flush_pipe_once_if_written(post_redirect_command: str) -> None:

@special_command(
"watch",
"watch [seconds] [-c] <query>",
"/watch [seconds] [-c] <query>",
"Execute query every [seconds] seconds (5 by default).",
)
def watch_query(arg: str, **kwargs) -> Generator[SQLResult, None, None]:
Expand Down Expand Up @@ -758,7 +758,7 @@ def watch_query(arg: str, **kwargs) -> Generator[SQLResult, None, None]:

@special_command(
"delimiter",
"delimiter <string>",
"/delimiter <string>",
"Change end-of-statement delimiter.",
)
def set_delimiter(arg: str, **_) -> list[SQLResult]:
Expand Down
Loading
Loading