Skip to content

tt connect interactive console: expanded formatting modes #3734

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 tasks
Tracked by #3754
TarantoolBot opened this issue Sep 25, 2023 · 0 comments · Fixed by #3994
Closed
2 tasks
Tracked by #3754

tt connect interactive console: expanded formatting modes #3734

TarantoolBot opened this issue Sep 25, 2023 · 0 comments · Fixed by #3994
Assignees
Labels

Comments

@TarantoolBot
Copy link
Collaborator

TarantoolBot commented Sep 25, 2023

Product: tt CLI
Since: ?
Audience/target: all
Root document: ? https://www.tarantool.io/en/doc/latest/reference/tooling/interactive_console/
? https://www.tarantool.io/en/doc/latest/reference/tooling/tt_cli/connect/
SME: @ GRISHNOV

Details

The patchset introduces addition commands for the tt connect console.

It adds several common commands that relate to a general functionality:

  • \help, ? - to show help message with additional information and
    a list of all commands.
  • \quit, \q - quit from the console. Previously this command worked
    on the tarantool side, but now it works on the tt side and does
    not require execution rights for a user.

In addition, the patch adds commands for extended output modes:

  • \set output <format> - set format lua, table, ttable or
    yaml (default)
  • \set table_format <format> - set table format default, jira
    or markdown
  • \set graphics <false/true> - disables/enables (default)
    pseudographics for table modes
  • \set table_column_width <width> - set max column width for
    table/ttable
  • \xw <width> - set max column width for table/ttable
  • \x - switches output format cyclically
  • \x[l,t,T,y] - set output format lua, table, ttable or yaml
  • \x[g,G] - disables/enables pseudographics for table modes

Supported formats:

  1. yaml - shows data as a YAML document. The format is
    used now by tarantool and tt.
  2. lua - shows data as Lua-compatible structs.
  3. table - shows data as a pseudo graphical table.
  4. ttable - the same as the table format, but a result table is
    transposed (rotate data from rows to columns).

Supported table formats (for table or ttable formats):

  1. default - shows data as a pseudo graphical table.
  2. markdown - shows data as a Markdown-compatible table.
  3. jira - shows data as a Jira-compatible table.

Example:

> \set output table
> box.space.customers:select()
+------+-----------+------+
| col1 | col2      | col3 |
+------+-----------+------+
| 1    | Elizabeth | 12   |
+------+-----------+------+
> \xg
> box.space.customers:select()
 col1  col2       col3
 1     Elizabeth  12
 2     Mary       46
 3     David      33

Requested by @GRISHNOV in tarantool/tt@5189d4f.

Definition of done

  • Define the relation between tt console and tarantool console to find the proper place for this doc
  • Describe the new formatting capabilities in the console documentation
@p7nov p7nov added the tt cli label Sep 28, 2023
@p7nov p7nov changed the title Expanded formatting modes tt connect: expanded formatting modes Sep 28, 2023
@p7nov p7nov changed the title tt connect: expanded formatting modes tt connect interactive console: expanded formatting modes Sep 28, 2023
@p7nov p7nov mentioned this issue Oct 5, 2023
5 tasks
@p7nov p7nov self-assigned this Jan 15, 2024
p7nov added a commit that referenced this issue Jan 22, 2024
Resolves #3734
Resolves #3820

* Add tt console docs
* Add tt connect SSL options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants