Skip to content

document \set output lua #839

Closed
Closed
@TarantoolBot

Description

@TarantoolBot

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.

Metadata

Metadata

Assignees

Labels

featureA new functionalityreference[location] Tarantool manual, Reference partserver[area] Task relates to Tarantool's server (core) functionality

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions