Skip to content

document \set output lua #839

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
TarantoolBot opened this issue Jul 24, 2019 · 1 comment
Closed

document \set output lua #839

TarantoolBot opened this issue Jul 24, 2019 · 1 comment
Assignees
Labels
feature A new functionality reference [location] Tarantool manual, Reference part server [area] Task relates to Tarantool's server (core) functionality

Comments

@TarantoolBot
Copy link
Collaborator

Historically we use YAML format to print results of operation to
a console. Moreover our test engine is aiming YAML as a primary format
to compare results of test runs. Still we need an ability to print
results in a different fasion, in particular one may need to use
the console in a REPL way so that the results would be copied and
pased back to further processing.

For this sake we introduce that named "output" command which allows
to specify which exactly output format to use. Currently only yaml
and lua formats are supported.

To specify lua output format type

| tarantool> \set output lua

in the console. lua mode supports line oriented output (default) or
block mode.

For example

| tarantool> a={1,2,3}

tarantool> a
- - 1
- 2
- 3
...
tarantool> \set output lua
true
tarantool> a
{1, 2, 3}
tarantool> \set output lua,block
true
tarantool> a
{
1,
2,
3
}

By default YAML output format is kept for now, simply to not
break the test engine. The output is bound to a session, thus every
new session should setup own conversion if needed.

Since serializing lua data is not a trivial task we use "serpent"
third party module to convert data.

Part-of #3834
Requested by @cyrillos in tarantool/tarantool@4272550.

@lenkis lenkis added 2.1 feature A new functionality reference [location] Tarantool manual, Reference part server [area] Task relates to Tarantool's server (core) functionality labels Jul 25, 2019
@pgulutzan
Copy link
Contributor

I added a section "Interactive console" describing the \set instructions including this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new functionality reference [location] Tarantool manual, Reference part server [area] Task relates to Tarantool's server (core) functionality
Projects
None yet
Development

No branches or pull requests

3 participants