Kouhei Sutou
null+****@clear*****
Sun Dec 28 22:40:19 JST 2014
Kouhei Sutou 2014-12-28 22:40:19 +0900 (Sun, 28 Dec 2014) New Revision: 884e81d3197ae639f79bc67408cfcb918131d7c4 https://github.com/groonga/groonga/commit/884e81d3197ae639f79bc67408cfcb918131d7c4 Message: doc truncate: update Modified files: doc/source/reference/commands/truncate.rst Renamed files: doc/source/example/reference/commands/truncate/truncate-table.log (from doc/source/example/reference/commands/truncate/truncate.log) Renamed: doc/source/example/reference/commands/truncate/truncate-table.log (+0 -0) 100% =================================================================== Modified: doc/source/reference/commands/truncate.rst (+28 -9) =================================================================== --- doc/source/reference/commands/truncate.rst 2014-12-28 22:36:26 +0900 (921cec8) +++ doc/source/reference/commands/truncate.rst 2014-12-28 22:40:19 +0900 (b453ff7) @@ -11,24 +11,28 @@ Summary ------- -``truncate`` command deletes all records from specified table. +``truncate`` command deletes all records from specified table or all +values from specified column. Syntax ------ ``truncate`` command takes only one parameter. -The required parameter is only ``table``:: +The required parameter is only ``target_name``:: - truncate table + truncate target_name + +For backward compatibility, ``truncate`` command accepts ``table`` +parameter. But it should not be used for newly written code. Usage ----- -Here is a simple example of ``truncate`` command. +Here is a simple example of ``truncate`` command against a table. .. groonga-command -.. include:: ../../example/reference/commands/truncate/truncate.log +.. include:: ../../example/reference/commands/truncate/truncate-table.log .. table_create Users TABLE_PAT_KEY ShortText .. load --table Users .. [ @@ -40,6 +44,21 @@ Here is a simple example of ``truncate`` command. .. truncate Users .. select Users +Here is a simple example of ``truncate`` command against a column. + +.. groonga-command +.. include:: ../../example/reference/commands/truncate/truncate-column.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.score +.. select Users + Parameters ---------- @@ -48,12 +67,12 @@ This section describes parameters of ``truncate``. Required parameter ^^^^^^^^^^^^^^^^^^ -There is required parameter, ``table_name``. +There is required parameter, ``target_name``. -``table_name`` -"""""""""""""" +``target_name`` +""""""""""""""" -It specifies the name of table. +It specifies the name of table or column. Return value ------------ -------------- next part -------------- HTML����������������������������... Descargar