.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "TARANTOOL 1" .TH TARANTOOL 1 "2019-07-21" "perl v5.28.1" "readline SQL-client for tarantool" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" tarantool \- readline\-based client for tarantool. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& tarantool [OPTIONS] [QUERY] .Ve .SH "Command-line options" .IX Header "Command-line options" .IP "\-h, \-\-host " 4 .IX Item "-h, --host " Server address. .IP "\-p, \-\-port " 4 .IX Item "-p, --port " Server port. .IP "\-a, \-\-admin\-port " 4 .IX Item "-a, --admin-port " Server admin port. .IP "\-C, \-\-cat " 4 .IX Item "-C, --cat " Print xlog or snapshot file content. .IP "\-P, \-\-play " 4 .IX Item "-P, --play " Replay xlog file to the specified server. .IP "\-S, \-\-space " 4 .IX Item "-S, --space " Filter by space number. .IP "\-F, \-\-from " 4 .IX Item "-F, --from " Start xlog file from the specified lsn. .IP "\-T, \-\-to " 4 .IX Item "-T, --to " Stop on specified xlog lsn. .IP "\-M, \-\-format " 4 .IX Item "-M, --format " Cat output format (tarantool, raw). .IP "\-H, \-\-header" 4 .IX Item "-H, --header" Add file header for the raw output. .IP "\-R, \-\-rpl " 4 .IX Item "-R, --rpl " Act as replica for the specified server. .IP "\-B, \-\-bin" 4 .IX Item "-B, --bin" Print \s-1STR\s0 in lua printer instead of \s-1NUM32\s0 and \s-1NUM64,\s0 except arithmetic update arguments. .IP "\-D, \-\-delim " 4 .IX Item "-D, --delim " If you use \-\-cat, then it will add delim to end of every line of your Lua file. when used at \s-1CLI\s0 start of client, then it's replacement of setopt delim='' command. .IP "\-?, \-\-help" 4 .IX Item "-?, --help" Display this help and exit. .IP "\-V, \-\-version" 4 .IX Item "-V, --version" Display version information and exit. .SH "DESCRIPTION" .IX Header "DESCRIPTION" Statements in alphabetical order .PP 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). .IP "\s-1CALL\s0" 4 .IX Item "CALL" Syntax: \s-1CALL\s0 procedure-identifier (). Effect: The client tells the server to execute the procedure identified by procedure-identifier. Example: \s-1CALL\s0 \fBproc50()\fR. Notes: The client sends to the server's read/write data port. .IP "\s-1DELETE\s0" 4 .IX Item "DELETE" Syntax: \s-1DELETE FROM\s0 tuple-set-name \s-1WHERE\s0 field-name = literal. Effect: Client tells server to delete the tuple identified by the \s-1WHERE\s0 clause. Example: \s-1DELETE FROM\s0 t0 \s-1WHERE\s0 k0='a'. Notes: field-name must identify the primary key. The client sends to the server's read/write data port after converting from \s-1SQL\s0 to binary protocol. .IP "\s-1EXIT\s0" 4 .IX Item "EXIT" Syntax: E[\s-1XIT\s0]. Effect: The tarantool program stops. Example: \s-1EXIT.\s0 Notes: The \s-1QUIT\s0 statement does the same thing. The client sends nothing to the server. .IP "\s-1HELP\s0" 4 .IX Item "HELP" Syntax: H[\s-1ELP\s0]. Effect: Client displays a message including a list of possible statements. Example: \s-1HELP.\s0 Notes: The client sends nothing to the server. .IP "\s-1INSERT\s0" 4 .IX Item "INSERT" Syntax: \s-1INSERT\s0 [\s-1INTO\s0] tuple-set-identifier \s-1VALUES\s0 (literal [,literal...]). Effect: The client tells the server to add the tuple consisting of the literal values. Example: \s-1INSERT INTO\s0 t0 \s-1VALUES\s0 ('a',0). Notes: The client sends to the server's read/write data port after converting from \s-1SQL\s0 to binary protocol. .IP "\s-1LOADFILE\s0" 4 .IX Item "LOADFILE" Syntax: \s-1LOADFILE\s0 string-literal. Effect: The client loads instructions from the file identified by string-literal. Example: \s-1LOADFILE\s0 '/home/tarantool_user/file5.txt'. .IP "\s-1LUA\s0" 4 .IX Item "LUA" Syntax: \s-1LUA\s0 token [token...]. Effect: The client tells the server to execute the tokens as Lua statements. Example: \s-1LUA\s0 \*(L"hello\*(R"..\*(L" world\*(R". Notes: The client sends to the server's administrative port. .IP "\s-1PING\s0" 4 .IX Item "PING" Syntax: \s-1PING.\s0 Effect: The client sends a ping to the server. Example: \s-1PING.\s0 Notes: The client sends to the server's read/write data port. .IP "\s-1QUIT\s0" 4 .IX Item "QUIT" Syntax: Q[\s-1UIT\s0]. Effect: The client stops. This statement is handled entirely by the client. Example: \s-1QUIT.\s0 Notes: The \s-1EXIT\s0 statement does the same thing. The client sends nothing to the server. .IP "\s-1RELOAD\s0" 4 .IX Item "RELOAD" Syntax: \s-1RELOAD CONFIGURATION.\s0 Effect: The client tells the server to re-read the configuration file. Example: \s-1RELOAD CONFIGURATION.\s0 Notes: The client sends to the server's administrative port. .IP "\s-1REPLACE\s0" 4 .IX Item "REPLACE" Syntax; \s-1REPLACE\s0 [\s-1INTO\s0] tuple-set-identifier \s-1VALUES\s0 (literal [,literal...]). Effect: The client tells the server to add the tuple consisting of the literal values. Example: \s-1REPLACE INTO\s0 t0 \s-1VALUES\s0 ('a',0). Notes: \s-1REPLACE\s0 and \s-1INSERT\s0 are the same, except that \s-1INSERT\s0 will return an error if a tuple already exists with the same primary key. The client sends to the server's read/write data port after converting from \s-1SQL\s0 to binary protocol. .IP "\s-1SAVE\s0" 4 .IX Item "SAVE" Syntax: \s-1SAVE COREDUMP\s0 | \s-1SNAPSHOT.\s0 Effect: The client tells the server to save the designated object. Example: \s-1SAVE SNAPSHOT.\s0 Notes: The client sends to the server's administrative port. .IP "\s-1SELECT\s0" 4 .IX Item "SELECT" Syntax: \s-1SELECT\s0 * \s-1FROM\s0 tuple-set-identifier \s-1WHERE\s0 field-identifier = literal [AND|OR field-identifier = literal...] [\s-1LIMIT\s0 numeric-literal [,numeric\-literal]]. Effect: Client tells server to find the tuple or tuples identified in the \s-1WHERE\s0 clause. Example: \s-1SELECT\s0 * \s-1FROM\s0 t0 \s-1WHERE\s0 k0 = 5 \s-1AND\s0 k1 = 7 \s-1LIMIT 1.\s0 Notes: The client sends to the server's read/write data port. .IP "\s-1SET\s0" 4 .IX Item "SET" Syntax: \s-1SET INJECTION\s0 name-token state-token. Effect: In normal mode: error. Notes: This statement is only available in debug mode. .IP "\s-1SETOPT\s0" 4 .IX Item "SETOPT" Syntax: \s-1SETOPT DELIMITER\s0 = string-literal. The string must be a value in single quotes. Effect: string becomes end-of-statement delimiter, so newline alone is not treated as end of statement. Example: \s-1SETOPT DELIMITER\s0 = '!'. Notes: The client sends nothing to the server. .Sp Syntax: \s-1SETOPT PAGER\s0 = 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: \s-1SETOPT PAGER\s0 = '/usr/bin/less'. Notes: The client sends nothing to the server. .IP "\s-1SHOW\s0" 4 .IX Item "SHOW" Syntax: \s-1SHOW CONFIGURATION\s0 | \s-1FIBER\s0 | \s-1INFO\s0 | \s-1INJECTIONS\s0 | \s-1PALLOC\s0 | \s-1PLUGINS\s0 | \s-1SLAB\s0 | \s-1STAT.\s0 Effect: The client asks the server for information about environment or statistics. Example: \s-1SHOW INFO.\s0 Notes: The client sends to the server's administrative port. \s-1SHOW INJECTIONS\s0 is only available in debug mode. .IP "\s-1UPDATE\s0" 4 .IX Item "UPDATE" Syntax: \s-1UPDATE\s0 tuple-set-identifier \s-1SET\s0 field-identifier = literal [,field\-identifier = literal...] \s-1WHERE\s0 field-identifier = literal. Effect: Client tells server to change the tuple identified in the \s-1WHERE\s0 clause. Example: \s-1UPDATE\s0 t1 \s-1SET\s0 k1= 'K', k2 = 7 \s-1WHERE\s0 k0 = 0. Notes: The client sends to the server's read/write data port after converting from \s-1SQL\s0 to binary protocol. .Sp For a condensed Backus-Naur Form [\s-1BNF\s0] description of some of the statements, see doc/box\-protocol.txt and doc/sql.txt. .SH "EXAMPLES" .IX Header "EXAMPLES" Depending how one combines the tarantool client's options, there are in effect three modes of operation: \*(L"interactive\*(R", \*(L"print and play\*(R", or \*(L"replication\*(R" mode. .PP 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 \s-1LOADFILE\s0 statement: (\s-1LOADFILE\s0 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: .PP .Vb 10 \& $ tarantool \& localhost> INSERT INTO t0 VALUES (\*(AqX\-1\*(Aq,100) \& Insert OK, 1 rows affected \& localhost> INSERT INTO t0 VALUES (\*(AqX\-2\*(Aq,200,\*(AqOn Order\*(Aq) \& Insert OK, 1 rows affected \& localhost> INSERT INTO t0 VALUES (\*(AqX\-3\*(Aq,300,\*(Aq\*(Aq) \& Insert OK, 1 rows affected \& localhost> UPDATE t0 SET k1 = 300 WHERE k0 = \*(AqX\-1\*(Aq \& Update OK, 1 rows affected \& localhost> DELETE FROM t0 WHERE k0 = \*(AqX\-2\*(Aq \& Delete OK, 1 rows affected \& localhost> SELECT * FROM t0 WHERE k0 = \*(AqX\-1\*(Aq \& Select OK, 1 rows affected \& [\*(AqX\-1\*(Aq, 300] \& localhost> EXIT \& $ .Ve .PP 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: .PP .Vb 7 \& $ 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 [\*(AqX\-1\*(Aq, 100] \& Insert, lsn: 23, time: 1385327353.346745, len: 42, space: 0, cookie: 127.0.0.1:44787 [\*(AqX\-2\*(Aq, 200, 8243105135088135759] \& Insert, lsn: 24, time: 1385327353.347352, len: 34, space: 0, cookie: 127.0.0.1:44787 [\*(AqX\-3\*(Aq, 300, \*(Aq\*(Aq] \& Update, lsn: 25, time: 1385327353.348209, len: 42, space: 0, cookie: 127.0.0.1:44787 [\*(AqX\-1\*(Aq] \& Delete, lsn: 26, time: 1385327353.348879, len: 28, space: 0, cookie: 127.0.0.1:44787 [\*(AqX\-2\*(Aq] \& $ .Ve .PP In replication mode, one connects as a replica, and then writes a binary log to a file.