[Tarantool-patches] [PATCH] Formatted select in lua console

Oleg Babin olegrok at tarantool.org
Fri Jul 10 18:37:25 MSK 2020


Hi! Thanks for your patch!

It's not a review, but I just tried to use it. Works fine for default 
yaml console. But seems it completely broken for lua output.


```

tarantool> box.space.test:fselect()
---
- - ​+-----+-----+-----+-----+-----+
   - ​|col1 |col2 |col3 |col4 |col5 |
   - ​+-----+-----+-----+-----+-----+
   - ​|  1  |     |     |     |     |
   - ​|  2  |  3  |     |     |     |
   - ​|  4  |  5  |null |null | 123 |
   - ​+-----+-----+-----+-----+-----+
...

tarantool> \set output lua
true;
tarantool> box.space.test:fselect()
{"\xe2\x80\x8b+-----+-----+-----+-----+-----+", 
"\xe2\x80\x8b|col1\xc2\xa0|col2\xc2\xa0|col3\xc2\xa0|col4\xc2\xa0|col5\xc2\xa0|", 
"\xe2\x80\x8b+-----+-----+-----+-----+-----+", 
"\xe2\x80\x8b|\xc2\xa0\xc2\xa01\xc2\xa0\xc2\xa0|\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0|\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0|\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0|\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0|", 
"\xe2\x80\x8b|\xc2\xa0\xc2\xa02\xc2\xa0\xc2\xa0|\xc2\xa0\xc2\xa03\xc2\xa0\xc2\xa0|\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0|\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0|\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0|", 
"\xe2\x80\x8b|\xc2\xa0\xc2\xa04\xc2\xa0\xc2\xa0|\xc2\xa0\xc2\xa05\xc2\xa0\xc2\xa0|null\xc2\xa0|null\xc2\xa0|\xc2\xa0123\xc2\xa0|", 
"\xe2\x80\x8b+-----+-----+-----+-----+-----+"};

```

May be we should throw an error for "lua output" case.

On 10/07/2020 13:03, Aleksandr Lyapunov wrote:
> Introduce space:fselect and index:fselect.
> The example is better than explanation:
>
> tarantool> _user:fselect{}
> ---
> - - ​+-----+-----+-------------+------+--------------------------------------------+
>    - ​| id  |owner|    name     | type |                    auth                    |
>    - ​+-----+-----+-------------+------+--------------------------------------------+
>    - ​|  0  |  1  |   "guest"   |"user"|{"chap-sha1":"vhvewKp0tNyweZQ+cFKAlsyphfg="}|
>    - ​|  1  |  1  |   "admin"   |"user"|                     {}                     |
>    - ​|  2  |  1  |  "public"   |"role"|                     {}                     |
>    - ​|  3  |  1  |"replication"|"role"|                     {}                     |
>    - ​| 31  |  1  |   "super"   |"role"|                     {}                     |
>    - ​+-----+-----+-------------+------+--------------------------------------------+
> ...
>
>
> Aleksandr Lyapunov (1):
>    Introduce fselect - formatted select
>
>   src/box/lua/schema.lua      | 105 ++++++++++++++++++++++++++++++++
>   test/engine/select.result   | 142 ++++++++++++++++++++++++++++++++++++++++++++
>   test/engine/select.test.lua |  25 ++++++++
>   3 files changed, 272 insertions(+)
>


More information about the Tarantool-patches mailing list