Skip to content

Commit

Permalink
Update tt console outpur format
Browse files Browse the repository at this point in the history
  • Loading branch information
p7nov committed Aug 29, 2024
1 parent ece1fcd commit 51e5c53
Showing 1 changed file with 23 additions and 18 deletions.
41 changes: 23 additions & 18 deletions doc/tooling/tt_cli/tt_interactive_console.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ using the ``\set output`` console command:
app:storage001> \set output table
app:storage001> box.space.bands:select { }
+------+-------------+------+
| col1 | col2 | col3 |
| id | band_name | year |
+------+-------------+------+
| 1 | Roxette | 1986 |
+------+-------------+------+
Expand All @@ -128,20 +128,25 @@ using the ``\set output`` console command:
| 3 | Ace of Base | 1987 |
+------+-------------+------+
.. note::

Field names are printed since Tarantool 3.2. On earlier versions,
actual names are replaced by numbered placeholders ``col1``, ``col2``, and so on.

The table output can be printed in the transposed format, where an object's fields
are arranged in columns instead of rows:

.. code-block:: console
app:storage001> \set output ttable
app:storage001> box.space.bands:select { }
+------+---------+-----------+-------------+
| col1 | 1 | 2 | 3 |
+------+---------+-----------+-------------+
| col2 | Roxette | Scorpions | Ace of Base |
+------+---------+-----------+-------------+
| col3 | 1986 | 1965 | 1987 |
+------+---------+-----------+-------------+
+-----------+---------+-----------+-------------+
| id | 1 | 2 | 3 |
+-----------+---------+-----------+-------------+
| band_name | Roxette | Scorpions | Ace of Base |
+-----------+---------+-----------+-------------+
| year | 1986 | 1965 | 1987 |
+-----------+---------+-----------+-------------+
.. note::

Expand All @@ -162,9 +167,9 @@ following commands:
app:storage001> \set table_format jira
app:storage001> box.space.bands:select {}
| col1 | 1 | 2 | 3 |
| col2 | Roxette | Scorpions | Ace of Base |
| col3 | 1986 | 1965 | 1987 |
| id | 1 | 2 | 3 |
| band_name | Roxette | Scorpions | Ace of Base |
| year | 1986 | 1965 | 1987 |
* ``\set grahpics`` -- enable or disable graphics for table cells in the default format:

Expand All @@ -173,20 +178,20 @@ following commands:
app:storage001> \set table_format default
app:storage001> \set graphics false
app:storage001> box.space.bands:select {}
col1 1 2 3
col2 Roxette Scorpions Ace of Base
col3 1986 1965 1987
id 1 2 3
band_name Roxette Scorpions Ace of Base
year 1986 1965 1987
* ``\set table_column_width`` -- maximum column width.

.. code-block:: console
app:storage001> \set table_column_width 6
app:storage001> box.space.bands:select {}
col1 1 2 3
col2 Roxett Scorpi Ace of
+e +ons + Base
col3 1986 1965 1987
id 1 2 3
band_n Roxett Scorpi Ace of
+ame +e +ons + Base
year 1986 1965 1987
.. _tt-interactive-console-commands:
Expand Down

0 comments on commit 51e5c53

Please sign in to comment.