Skip to content

Add tt console docs #3994

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

Merged
merged 4 commits into from
Jan 22, 2024
Merged

Add tt console docs #3994

merged 4 commits into from
Jan 22, 2024

Conversation

p7nov
Copy link
Contributor

@p7nov p7nov commented Jan 18, 2024

Resolves #3734
Resolves #3820

Deployment: https://docs.d.tarantool.io/en/doc/gh-3734-tt-connect-console/reference/tooling/tt_cli/tt_interactive_console/

To cherry pick to 2.11

@p7nov p7nov force-pushed the gh-3734-tt-connect-console branch from 9263ce3 to 3e233a7 Compare January 18, 2024 09:35
@p7nov p7nov requested a review from oleg-jukovec January 18, 2024 09:35
Copy link
Contributor

@oleg-jukovec oleg-jukovec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@@ -28,6 +28,20 @@ Options

``-`` – read the script from stdin.

.. option:: -i, --interactive
Copy link
Contributor

@oleg-jukovec oleg-jukovec Jan 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a bit more tt connect flags:

      --sslcafile string      path to a trusted certificate authorities (CA) file
      --sslcertfile string    path to an SSL certificate file
      --sslciphers string     colon-separated (:) list of SSL cipher suites the connection
      --sslkeyfile string     path to a private SSL key file

Or is this not relevant to the issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, added these options and missing tt connect auth methods (URI string and env variables).

@p7nov p7nov requested a review from andreyaksenov January 19, 2024 05:28
Copy link
Contributor

@andreyaksenov andreyaksenov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Please see my comments and suggestions below.

tt interactive console
======================

The ``tt`` utility features an command-line console that allows executing requests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The ``tt`` utility features an command-line console that allows executing requests
The ``tt`` utility features a command-line console that allows executing requests

\\set table_colum_width WIDTH, \\xw WIDTH
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Set maximum printed width of a table cell content. If the length exceeds this value,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Set maximum printed width of a table cell content. If the length exceeds this value,
Set the maximum printed width of a table cell content. If the length exceeds this value,

and Lua code interactively on the connected Tarantool instances.
It is similar to the :ref:`Tarantool interactive console <interactive_console>` with
one key difference: the ``tt`` console allows connecting to any available instance,
both local and remote. Additionally, it offers more flexible output formatting capabilities.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

both local and remote

We have the Security topic (I don't know why it has such a name) that describes the difference between local and remote connections. Most of the contnet might be dropped but the main points are:

  • A local connection (tt connect <instance_name>) opens a console for the admin user.
  • A remote connection (tt connect <iproto_socket/address>) requires credentials for administration. Otherwise, the guest user is used.

So, I'd add the link to this topic or added a couple of sentences about this difference to the Entering the console section.

- [1, 'Roxette', 1986]
...

.. code-block:: console
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a short sentence on what this code snippet does.

- - [1, 'Roxette', 1986]
...

.. note::
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me, this note looks more important than the info about tab-based autocompletion because it describes the second way on how to change the input. So, I'd write this note as a regular sentence and the info about autocompletion as a note. Just a suggestion, up to you.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd leave this a note because it's a bit out of the page's context: it's not about working in the console, but an external way to select the language.

Possible values:

* ``lua`` (default)
* ``sql``.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't remember our guidelines for lists but I'd remove the dot after sql

``yaml`` > ``lua`` > ``table`` > ``ttable``.

The format of ``table`` and ``ttable`` output can be adjusted using the ``\set table_format``,
``\set graphics`, and ``\set table_colum_width`` commands.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
``\set graphics`, and ``\set table_colum_width`` commands.
``\set graphics``, and ``\set table_colum_width`` commands.

``tt connect`` connects to a Tarantool instance by its URI or name specified
during its startup (``tt start``).
``tt connect`` connects to a Tarantool instance by its URI or instance name specified
in the current environment.

Options
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's expand -u and -p descriptions a bit. Username four times in a row looks a bit weird :)

image


.. option:: --sslcafile FILEPATH

The path to an SSL certificate file for encrypted connections.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the descriptions for --sslcafile and --sslcertfile should be swapped.


To connect to instances that use SSL encryption, provide the SSL certificate path and
other encryption parameters in the options ``--sslcertfile``, ``--sslcafile``,
``--sslkeyfile``, and ``--sslciphers``.
Copy link
Contributor

@andreyaksenov andreyaksenov Jan 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strictly speaking, --sslcertfile and --sslkeyfile are mandatory. Other parameters are optional.

@p7nov p7nov requested a review from andreyaksenov January 22, 2024 07:39
@p7nov p7nov merged commit 9cb1798 into latest Jan 22, 2024
@p7nov p7nov deleted the gh-3734-tt-connect-console branch January 22, 2024 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tt connect command has no information about SSL options tt connect interactive console: expanded formatting modes
3 participants