Kouhei Sutou
null+****@clear*****
Mon Mar 31 18:56:19 JST 2014
Kouhei Sutou 2014-03-31 18:56:19 +0900 (Mon, 31 Mar 2014) New Revision: ed08d4fccc6719b2f8a79bbd2dba0f66917c0852 https://github.com/groonga/groonga/commit/ed08d4fccc6719b2f8a79bbd2dba0f66917c0852 Message: doc: update column_list TODO: * Update file list * Generate examples * Confirm output Modified files: doc/source/reference/commands/column_list.txt Modified: doc/source/reference/commands/column_list.txt (+165 -67) =================================================================== --- doc/source/reference/commands/column_list.txt 2014-03-31 18:55:15 +0900 (17a5083) +++ doc/source/reference/commands/column_list.txt 2014-03-31 18:56:19 +0900 (6a2e495) @@ -2,110 +2,208 @@ .. highlightlang:: none -column_list -=========== +.. groonga-command +.. database: commands_column_list -名前 ----- +``column_list`` +=============== -column_list - テーブルに定義されているカラムのリスト表示 +Summary +------- -書式 ----- -:: +``column_list`` command lists columns in a table. - column_list table +Syntax +------ -説明 ----- +``column_list`` command takes one required parameter:: -Groonga組込コマンドの一つであるcolumn_listについて説明します。組込コマンドは、groonga実行ファイルの引数、標準入力、またはソケット経由でgroongaサーバにリクエストを送信することによって実行します。 + column_list table -column_listはテーブルに定義されているカラムをリスト表示します。 +Usage +----- -引数 ----- +Here is a simple example of ``column_list`` command. + +.. groonga-command +.. include:: ../../example/reference/commands/column_list/column_list.log +.. table_create Users TABLE_PAT_KEY ShortText +.. column_create Users age COLUMN_SCALAR UInt8 +.. column_create Users tags COLUMN_VECTOR ShortText +.. column_list Users + + +Parameters +---------- + +This section describes parameters of ``column_list``. + +Required parameters +^^^^^^^^^^^^^^^^^^^ + +All parameters are required. ``table`` - カラム情報を出力するテーブルの名前を指定します。 +""""""""" + +It specifies the name of table to be listed columns. + +Return value +------------ + +``column_list`` returns the list of column information in the table:: + + [ + HEADER, + [ + COLUMN_LIST_HEADER, + COLUMN_INFORMATION1, + COLUMN_INFORMATION2, + ... + ] + ] + +``HEADER`` + + See :doc:`/reference/command/output_format` about ``HEADER``. + +``COLUMN_LIST_HEADER`` + + ``COLUMN_LIST_HEADER`` describes about content of each + ``COLUMN_INFORMATION``. + + ``COLUMN_LIST_HEADER`` is the following format:: + + [ + ["id", "UInt32"], + ["name", "ShortText"], + ["path", "ShortText"], + ["type", "ShortText"], + ["flags", "ShortText"], + ["domain", "ShortText"], + ["range", "ShortText"], + ["source", "ShortText"] + ] + + It means the following: + + * The first content in ``COLUMN_INFORMATION`` is ``id`` value and + the value type is ``UInt32``. + * The second content in ``COLUMN_INFORMATION`` is ``name`` value and + the value type is ``ShortText``. + * The third content .... + + See the following ``COLUMN_INFORMATION`` description for details. -返値 ----- + This field provides meta-data of column information. So this field + will be useful for programs rather than humans. -json形式 -^^^^^^^^ +``COLUMN_INFORMATION`` -カラム名一覧を以下の形式で返却します。:: + Each ``COLUMN_INFORMATION`` is the following format:: - [[[カラム情報名1,カラム情報型1],...], カラム情報1,...] + [ + ID, + NAME, + PATH, + TYPE, + FLAGS, + DOMAIN, + RANGE, + SOURCES + ] -``カラム情報名n`` + ``ID`` - ``カラム情報n`` には複数の情報が含まれますが、そこに入る情報がどんな内容かを示す名前を出力します。 - 情報名は以下の通りです。 + The column ID in the Groonga database. Normally, you don't care + about it. - ``id`` + ``NAME`` - カラムオブジェクトに割り当てられたID + The column name. - ``name`` + ``PATH`` - カラム名 + The path for storing column data. - ``path`` + ``TYPE`` - カラム値を格納するファイル名 + The type of the column. It is one of the followings: - ``type`` + .. list-table:: + :header-rows: - スカラ型、ベクタ型、インデックス型の種別 + * - Value + - Description + * - ``fix`` + - The column is a fixed size column. Scalar column that its + type is fixed size type is fixed size column. + * - ``var`` + - The column is a variable size column. Vector column or + scalar column that its type is variable size type are + variable size column. + * - ``index`` + - The column is an index column. - ``flags`` + ``FLAGS`` - カラムのflags属性 + The flags of the column. Each flag is separated by ``|`` like + ``COLUMN_VECTOR|WITH_WEIGHT``. ``FLAGS`` must include one of + ``COLUMN_SCALAR``, ``COLUMN_VECTOR`` or ``COLUMN_INDEX``. Other + flags are optional. - ``domain`` + Here is the available flags: - カラムの値の属する型 + .. list-table:: + :header-rows: - ``range`` + * - Flag + - Description + * - ``COLUMN_SCALAR`` + - The column is a scalar column. + * - ``COLUMN_VECTOR`` + - The column is a vector column. + * - ``COLUMN_INDEX`` + - The column is an index column. + * - ``WITH_WEIGHT`` + - The column can have weight. ``COLUMN_VECTOR`` and ``COLUMN_INDEX`` + may have it. ``COLUMN_SCALAR`` doesn't have it. + * - ``WITH_SECTION`` + - The column can have section information. ``COLUMN_INDEX`` + may have it. ``COLUMN_SCALAR`` and ``COLUMN_VECTOR`` don't + have it. - テーブルのkeyの型 + Multiple column index has it. + * - ``WITH_POSITION`` + - The column can have position information. ``COLUMN_INDEX`` + may have it. ``COLUMN_SCALAR`` and ``COLUMN_VECTOR`` don't + have it. - ``source`` + Full text search index must has it. + * - ``PERSISTENT`` + - The column is a persistent column. It means that the column + isn't a :doc:`/reference/columns/pseudo`. - インデックスカラムのとき、インデックス対象カラム名の配列 + ``DOMAIN`` -``カラム情報型n`` + The name of table that has the column. - カラム情報の型を出力します。 + ``RANGE`` -``カラム情報n`` + The value type name of the column. It is a type name or a table + name. - ``カラム情報名n`` で示された情報の配列を出力します。 - 情報の順序は ``カラム情報名n`` の順序と同じです。 + ``SOURCES`` -例 --- -:: + An array of the source column names of the index. If the index + column is multiple column index, the array has two or more + source column names. - column_list Entry + It is always an empty array for ``COLUMN_SCALAR`` and + ``COLUMN_VECTOR``. - [[["id", "UInt32"], - ["name","ShortText"], - ["path","ShortText"], - ["type","ShortText"], - ["flags","ShortText"], - ["domain", "ShortText"], - ["range", "ShortText"], - ["source","ShortText"]], - [258, - "Entry.body", - "test.db.0000102", - "var", - "COLUMN_SCALAR|COMPRESS_NONE|PERSISTENT", - "Entry", - "ShortText", - []]] +See also +-------- -注: 実際は改行が入りません。 +* :doc:`/reference/commands/column_create` +* :doc:`/reference/column` -------------- next part -------------- HTML����������������������������...Download