-
Notifications
You must be signed in to change notification settings - Fork 43
Closed
Description
Related dev. issue(s): tarantool/tt#832
Product: tt
Since: 2.4.0 (Tarantool 3.2 or higher)
Root document: \set output FORMAT, \x{l|t|T|y}, \x (looks like additional docs are not required)
SME: @ DerekBum
Details
This patch adds support for formatting Tarantool tuples. Installed
Tarantool version must be >= 3.2. Otherwise, there will be no change.
Examples:
> f = box.tuple.format.new({{'id', 'number'}, {'name', 'string'}})
---
...
> t = box.tuple.new({1, 'Flint', true}, {format = f})
---
...
> \xt
> t
+----+-------+------+
| id | name | col1 |
+----+-------+------+
| 1 | Flint | true |
+----+-------+------+
> box.space.customers:select()
+----+-----------+-----+
| id | name | age |
+----+-----------+-----+
| 1 | Elizabeth | 12 |
+----+-----------+-----+
| 2 | Mary | 46 |
+----+-----------+-----+
> \xT
> t
+------+-------+
| id | 1 |
+------+-------+
| name | Flint |
+------+-------+
| col1 | true |
+------+-------+
> box.space.customers:select()
+------+-----------+------+
| id | 1 | 2 |
+------+-----------+------+
| name | Elizabeth | Mary |
+------+-----------+------+
| age | 12 | 46 |
+------+-----------+------+
Requested by @ DerekBum in tarantool/tt@8b94b74.
Metadata
Metadata
Assignees
Labels
No labels