项目作者: parihaaraka

项目描述 :
batch mode command line tarantool client to call function or execute script
高级语言: C++
项目地址: git://github.com/parihaaraka/tntcall.git
创建时间: 2019-11-28T14:40:38Z
项目社区:https://github.com/parihaaraka/tntcall

开源协议:MIT License

下载


tntcall

Usage

tntcall <connection_string> <function_name> [ARG|SEP][, ARG|SEP]...

tntcall <connection_string> -e <script_to_eval> [ARG|SEP][, ARG|SEP]...

tntcall <connection_string> -f <file_to_eval> [ARG|SEP][, ARG|SEP]...

ARG

-n nil

[-i ]<arg> integer(-i) or string

SEP

-A begin array

-a end array

-M begin map

-m end map

Outputs json-like formatted data by means of msgpuck‘s mp_snprint().
You may try to use jq to deal with
the output.

Besides connection string format described here
there is another option: env/:<environment_variable_name>.

Examples

  1. $ ./tntcall 'user:pass@127.0.0.1:3301' -e 'local a,b = ...; return a+b, a-b, {ok=true}' -i 3 -i 2
  2. > [5, 1, {"ok": true}]
  3. $ ./tntcall 'user:pass@127.0.0.1:3301' -e 'return table.concat({...})' hello \ world
  4. > "hello world"
  5. $ ./tntcall 'user:pass@127.0.0.1:3301' os.date '%A %B %d'
  6. > "Friday November 29"
  7. $ ./tntcall 'user:pass@127.0.0.1:3301' -e 'return ...' -i 123
  8. > 123
  9. $ ./tntcall 'user:pass@127.0.0.1:3301' box.cfg -M memtx_memory -i 2147483648 -m
  10. >
  11. $ ./tntcall 'user:pass@127.0.0.1:3301' -e 'return box.cfg.memtx_memory'
  12. > 2147483648