HAYASHI Kentaro
null+****@clear*****
Mon Feb 25 16:45:37 JST 2013
HAYASHI Kentaro 2013-02-25 16:45:37 +0900 (Mon, 25 Feb 2013) New Revision: 1a5046286b813ccc8c0d0ec16b38fa27087ac62c https://github.com/groonga/groonga/commit/1a5046286b813ccc8c0d0ec16b38fa27087ac62c Log: doc en: add missing documentation about truncate command Added files: doc/source/example/reference/commands/truncate/truncate.log doc/source/reference/commands/truncate.txt Added: doc/source/example/reference/commands/truncate/truncate.log (+75 -0) 100644 =================================================================== --- /dev/null +++ doc/source/example/reference/commands/truncate/truncate.log 2013-02-25 16:45:37 +0900 (f37c08c) @@ -0,0 +1,75 @@ +Execution example:: + + table_create Users TABLE_PAT_KEY ShortText + # [[0, 1337566253.89858, 0.000355720520019531], true] + load --table Users + [ + {"_key": "Alice", "score": 2}, + {"_key": "Bob", "score": 0}, + {"_key": "Carlos", "score": -1} + ] + # [[0, 1337566253.89858, 0.000355720520019531], 3] + select Users + # [ + # [ + # 0, + # 1337566253.89858, + # 0.000355720520019531 + # ], + # [ + # [ + # [ + # 3 + # ], + # [ + # [ + # "_id", + # "UInt32" + # ], + # [ + # "_key", + # "ShortText" + # ] + # ], + # [ + # 1, + # "Alice" + # ], + # [ + # 2, + # "Bob" + # ], + # [ + # 3, + # "Carlos" + # ] + # ] + # ] + # ] + truncate Users + # [[0, 1337566253.89858, 0.000355720520019531], true] + select Users + # [ + # [ + # 0, + # 1337566253.89858, + # 0.000355720520019531 + # ], + # [ + # [ + # [ + # 0 + # ], + # [ + # [ + # "_id", + # "UInt32" + # ], + # [ + # "_key", + # "ShortText" + # ] + # ] + # ] + # ] + # ] Added: doc/source/reference/commands/truncate.txt (+73 -0) 100644 =================================================================== --- /dev/null +++ doc/source/reference/commands/truncate.txt 2013-02-25 16:45:37 +0900 (508fa01) @@ -0,0 +1,73 @@ +.. -*- rst -*- + +.. highlightlang:: none + +.. groonga-command +.. database: commands_truncate + +``truncate`` +============ + +Summary +------- + +``truncate`` command deletes all records from specified table. + +Syntax +------ + +``truncate`` command takes only one parameter. + +The required parameter is only ``table``:: + + truncate table + +Usage +----- + +Here is a simple example of ``truncate`` command. + +.. groonga-command +.. include:: ../../example/reference/commands/truncate/truncate.log +.. table_create Users TABLE_PAT_KEY ShortText +.. load --table Users +.. [ +.. {"_key": "Alice", "score": 2}, +.. {"_key": "Bob", "score": 0}, +.. {"_key": "Carlos", "score": -1} +.. ] +.. select Users +.. truncate Users +.. select Users + +Parameters +---------- + +This section describes parameters of ``truncate``. + +Required parameter +^^^^^^^^^^^^^^^^^^ + +There is required parameter, ``table_name``. + +``table_name`` +"""""""""""""" + +It specifies the name of table. + +Return value +------------ + +:: + + [HEADER, truncated] + +``HEADER`` + + The format of HEADER is [0, UNIX_TIME_WHEN_COMMAND_IS_STARTED, ELAPSED_TIME]. + See :doc:`/reference/command/output_format` about HEADER. + +``truncated`` + + If command succeeded, it returns true, otherwise it returns false on error. + -------------- next part -------------- HTML����������������������������... Download