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

Feature tuple:format to get a format of a tuple #10005

Open
oleg-jukovec opened this issue May 13, 2024 · 0 comments · May be fixed by DerekBum/tarantool#1
Open

Feature tuple:format to get a format of a tuple #10005

oleg-jukovec opened this issue May 13, 2024 · 0 comments · May be fixed by DerekBum/tarantool#1
Assignees
Labels
feature A new functionality teamE

Comments

@oleg-jukovec
Copy link
Contributor

oleg-jukovec commented May 13, 2024

Is your feature request related to a problem? Please describe.

We need to be able to output tuples in tt with their names in a table format. Something like this:

id age field
1 1 'foo'
2 2 'bar'

Describe the solution you'd like

The format could be set per tuple at now:
https://github.com/tarantool/tarantool/pull/8549/commits

I want to be able to get the format object from a tuple with Lua:

local format = tuple:format()

It will allow me to get mapping field number - field name for the tuple from the format object.

Describe alternatives you've considered

tuple:tomap() returns a field name - value, a field number - value mapping. Unfortunately, this does not allow map values by a field name - value in the field number order.

We can add the option to tuple:totable(), it looks less obvious from the user point of view.

Definition of Done

It is possible to get mapping: field name - field value in the field number order for a tuple.

@oleg-jukovec oleg-jukovec added the feature A new functionality label May 13, 2024
DerekBum added a commit that referenced this issue May 30, 2024
This patch adds `tuple:get_format()` method to get a format
of a tuple.

Closes #10005
DerekBum added a commit that referenced this issue May 30, 2024
This patch adds `tuple:get_format()` method to get a format
of a tuple.

Closes #10005

@TarantoolBot document
Title: New `get_format` method for `box.tuple`
Product: Tarantool
Since: 3.1

The `tuple:get_format` method returns a format of a tuple.
DerekBum added a commit to DerekBum/tarantool that referenced this issue May 31, 2024
This patch adds `tuple:get_format()` method to get a format
of a tuple.

Closes tarantool#10005

@TarantoolBot document
Title: New `get_format` method for `box.tuple`
Product: Tarantool
Since: 3.1

The `tuple:get_format` method returns a format of a tuple.
DerekBum added a commit to DerekBum/tarantool that referenced this issue May 31, 2024
This patch adds `tuple:get_format()` method to get a format
of a tuple.

Closes tarantool#10005

@TarantoolBot document
Title: New `get_format` method for `box.tuple`
Product: Tarantool
Since: 3.1

The `tuple:get_format` method returns a format of a tuple.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new functionality teamE
Projects
None yet
2 participants