Skip to content
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

Describe end of statement symbol in Lua interactive console #3604

Merged
merged 4 commits into from
Aug 3, 2023

Conversation

p7nov
Copy link
Contributor

@p7nov p7nov commented Aug 2, 2023

Resolves #3314

  • Added an instruction how to set local_eos to the Interactive console page.
  • Revised old texts around.

Deployment: https://docs.d.tarantool.io/en/doc/gh-3314-local-eos/reference/tooling/interactive_console/

@Lord-KA
Copy link

Lord-KA commented Aug 2, 2023

Nit (I think, it is better to clarify a bit):

It is added to the end of each output statement and can be used for parsing the output by scripts.

e.g. for interactive or diff tests.

@Lord-KA
Copy link

Lord-KA commented Aug 2, 2023

for example, set output lua,local_eos=#`.

It seems like '`' is a tipo, if it isn't, feel free to ignore.

@Lord-KA
Copy link

Lord-KA commented Aug 2, 2023

Also, it might be good to add that local_eos is configured per session and isn't global.

Copy link

@Lord-KA Lord-KA 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 for the patch! See some minor comments above, otherwise, LGTM.

But a common recommendation is to say ``set delimiter ;`` especially if input is SQL.
The **delimiter** can be changed to any character with ``\set delimiter <character>``.
By default, the delimiter is empty, which means the input does not need to end
with a delimiter. To change the delimiter, run ``set delimiter <delimiter>``.
Copy link
Contributor

@andreyaksenov andreyaksenov Aug 2, 2023

Choose a reason for hiding this comment

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

The third sentence in this paragraph duplicates the info on how to change the delimiter but with slightly different syntax (with and without the backslash):

\set delimiter <character>
vs
set delimiter <delimiter>

And the second variant gives the error without the backslash:

tarantool> set delimiter ;
{error = "[string \"set delimiter ;\"]:1: \'=\' expected near \'delimiter\'"}#

can be used for parsing the output by scripts. By default, the end of statement
symbol is empty. You can change it to any character or character sequence.
To set an end of statement symbol for the current session, run ``set output lua,local_eos=<symbol>``,
for example, ``set output lua,local_eos=#``.
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above - get the error without the backslash:

tarantool> set output lua,local_eos=#
{error = "[string \"set output lua,local_eos=#\"]:1: \'=\' expected near \'output\'"}
tarantool> \set output lua,local_eos=#
true#

And, maybe, it's a matter of preference but I'd place the example in a separate code block to better highlight it. Up to you.

@p7nov p7nov merged commit c45e0ed into latest Aug 3, 2023
1 check passed
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.

configure local End Of Statement symbol in Lua console output
3 participants