[Groonga-commit] groonga/groonga [master] doc en: add missing documentation about column_rename command

Zurück zum Archiv-Index

HAYASHI Kentaro null+****@clear*****
Mon Feb 25 17:04:13 JST 2013


HAYASHI Kentaro	2013-02-25 17:04:13 +0900 (Mon, 25 Feb 2013)

  New Revision: d1fc14ca6e7b9867ff355b1182fb25f9744ef023
  https://github.com/groonga/groonga/commit/d1fc14ca6e7b9867ff355b1182fb25f9744ef023

  Log:
    doc en: add missing documentation about column_rename command

  Added files:
    doc/source/example/reference/commands/column_rename/column_rename.log
    doc/source/reference/commands/column_rename.txt

  Added: doc/source/example/reference/commands/column_rename/column_rename.log (+123 -0) 100644
===================================================================
--- /dev/null
+++ doc/source/example/reference/commands/column_rename/column_rename.log    2013-02-25 17:04:13 +0900 (e486c0a)
@@ -0,0 +1,123 @@
+Execution example::
+
+  table_create Users TABLE_PAT_KEY ShortText
+  # [[0, 1337566253.89858, 0.000355720520019531], true]
+  column_create Users score COLUMN_SCALAR Int32
+  # [[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]
+  column_rename Users score point
+  # [[0, 1337566253.89858, 0.000355720520019531], true]
+  column_list Users
+  # [
+  #   [
+  #     0, 
+  #     1337566253.89858, 
+  #     0.000355720520019531
+  #   ], 
+  #   [
+  #     [
+  #       [
+  #         "id", 
+  #         "UInt32"
+  #       ], 
+  #       [
+  #         "name", 
+  #         "ShortText"
+  #       ], 
+  #       [
+  #         "path", 
+  #         "ShortText"
+  #       ], 
+  #       [
+  #         "type", 
+  #         "ShortText"
+  #       ], 
+  #       [
+  #         "flags", 
+  #         "ShortText"
+  #       ], 
+  #       [
+  #         "domain", 
+  #         "ShortText"
+  #       ], 
+  #       [
+  #         "range", 
+  #         "ShortText"
+  #       ], 
+  #       [
+  #         "source", 
+  #         "ShortText"
+  #       ]
+  #     ], 
+  #     [
+  #       256, 
+  #       "_key", 
+  #       "", 
+  #       "", 
+  #       "COLUMN_SCALAR", 
+  #       "Users", 
+  #       "ShortText", 
+  #       []
+  #     ], 
+  #     [
+  #       257, 
+  #       "point", 
+  #       "/tmp/groonga-databases/commands_column_rename.0000101", 
+  #       "fix", 
+  #       "COLUMN_SCALAR|PERSISTENT", 
+  #       "Users", 
+  #       "Int32", 
+  #       []
+  #     ]
+  #   ]
+  # ]
+  select Users
+  # [
+  #   [
+  #     0, 
+  #     1337566253.89858, 
+  #     0.000355720520019531
+  #   ], 
+  #   [
+  #     [
+  #       [
+  #         3
+  #       ], 
+  #       [
+  #         [
+  #           "_id", 
+  #           "UInt32"
+  #         ], 
+  #         [
+  #           "_key", 
+  #           "ShortText"
+  #         ], 
+  #         [
+  #           "point", 
+  #           "Int32"
+  #         ]
+  #       ], 
+  #       [
+  #         1, 
+  #         "Alice", 
+  #         2
+  #       ], 
+  #       [
+  #         2, 
+  #         "Bob", 
+  #         0
+  #       ], 
+  #       [
+  #         3, 
+  #         "Carlos", 
+  #         -1
+  #       ]
+  #     ]
+  #   ]
+  # ]

  Added: doc/source/reference/commands/column_rename.txt (+79 -0) 100644
===================================================================
--- /dev/null
+++ doc/source/reference/commands/column_rename.txt    2013-02-25 17:04:13 +0900 (4d17d1f)
@@ -0,0 +1,79 @@
+.. -*- rst -*-
+
+.. highlightlang:: none
+
+.. groonga-command
+.. database: commands_column_rename
+
+``column_rename``
+=================
+
+Summary
+-------
+
+``column_rename`` command renames specified column name of table.
+
+Syntax
+------
+
+``column_rename`` command takes two parameters.
+
+The required parameter is ``table`` and ``column_name``::
+
+  column_rename table column
+
+Usage
+-----
+
+Here is a simple example of ``column_rename`` command.
+
+.. groonga-command
+.. include:: ../../example/reference/commands/column_rename/column_rename.log
+.. table_create Users TABLE_PAT_KEY ShortText
+.. column_create Users score COLUMN_SCALAR Int32
+.. load --table Users
+.. [
+.. {"_key": "Alice",  "score": 2},
+.. {"_key": "Bob",    "score": 0},
+.. {"_key": "Carlos", "score": -1}
+.. ]
+.. column_rename Users score point
+.. column_list Users
+.. select Users
+
+Parameters
+----------
+
+This section describes parameters of ``column_rename``.
+
+Required parameter
+^^^^^^^^^^^^^^^^^^
+
+There are required parameters, ``table_name`` and ``column_name``.
+
+``table_name``
+""""""""""""""
+
+It specifies the name of table.
+
+``column_name``
+""""""""""""""
+
+It specifies the name of column.
+
+Return value
+------------
+
+::
+
+ [HEADER, column_renamed]
+
+``HEADER``
+
+  The format of HEADER is [0, UNIX_TIME_WHEN_COMMAND_IS_STARTED, ELAPSED_TIME].
+  See :doc:`/reference/command/output_format` about HEADER.
+
+``column_renamed``
+
+  If command succeeded, it returns true, otherwise it returns false on error.
+
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Zurück zum Archiv-Index