TARANTOOL(1) | readline SQL-client for tarantool | TARANTOOL(1) |
tarantool - readline-based client for tarantool.
tarantool [OPTIONS] [QUERY]
Statements in alphabetical order
Although an initial statement may be entered on the tarantool command line, generally they are entered following the prompt in interactive mode while tarantool is running. (A prompt will be the name of the host and a greater-than sign, for example localhost>). The end-of-statement marker is a newline (line feed).
Syntax: SETOPT PAGER = string-literal. The string must be a value in single quotes. Effect: string becomes the pager that will be invoked for subsequent commands; usually the values are '/usr/bin/less' or '/bin/more' for the common Linux pagers. Example: SETOPT PAGER = '/usr/bin/less'. Notes: The client sends nothing to the server.
For a condensed Backus-Naur Form [BNF] description of some of the statements, see doc/box-protocol.txt and doc/sql.txt.
Depending how one combines the tarantool client's options, there are in effect three modes of operation: "interactive", "print and play", or "replication" mode.
In interactive mode, one types statements and gets results. One can specify a statement file when starting (tarantool < file_name) or one can specify a statement file with the LOADFILE statement: (LOADFILE file_name), but typically the statements are typed in by the user following prompts. Here is an example of an interactive-mode tarantool client session:
$ tarantool localhost> INSERT INTO t0 VALUES ('X-1',100) Insert OK, 1 rows affected localhost> INSERT INTO t0 VALUES ('X-2',200,'On Order') Insert OK, 1 rows affected localhost> INSERT INTO t0 VALUES ('X-3',300,'') Insert OK, 1 rows affected localhost> UPDATE t0 SET k1 = 300 WHERE k0 = 'X-1' Update OK, 1 rows affected localhost> DELETE FROM t0 WHERE k0 = 'X-2' Delete OK, 1 rows affected localhost> SELECT * FROM t0 WHERE k0 = 'X-1' Select OK, 1 rows affected ['X-1', 300] localhost> EXIT $
In print and play mode, one uses --cat and --play and --from and --to and --space options to print write-ahead-log contents, or to send write-ahead-log contents to the server. Here is an example of a print-and-play-mode tarantool client session:
$ tarantool --cat /home/user1/tarantool_test/work_dir/00000000000000000005.xlog --from 22 --to 26 Insert, lsn: 22, time: 1385327353.345869, len: 33, space: 0, cookie: 127.0.0.1:44787 ['X-1', 100] Insert, lsn: 23, time: 1385327353.346745, len: 42, space: 0, cookie: 127.0.0.1:44787 ['X-2', 200, 8243105135088135759] Insert, lsn: 24, time: 1385327353.347352, len: 34, space: 0, cookie: 127.0.0.1:44787 ['X-3', 300, ''] Update, lsn: 25, time: 1385327353.348209, len: 42, space: 0, cookie: 127.0.0.1:44787 ['X-1'] Delete, lsn: 26, time: 1385327353.348879, len: 28, space: 0, cookie: 127.0.0.1:44787 ['X-2'] $
In replication mode, one connects as a replica, and then writes a binary log to a file.
2019-01-28 | perl v5.28.1 |