Kouhei Sutou
null+****@clear*****
Fri Aug 7 17:23:18 JST 2015
Kouhei Sutou 2015-08-07 17:23:18 +0900 (Fri, 07 Aug 2015) New Revision: c7a26fd8aea305dd38192388739e5c0a14b69500 https://github.com/groonga/groonga/commit/c7a26fd8aea305dd38192388739e5c0a14b69500 Message: doc: document object_exist TODO: Translate me. Added files: doc/source/example/reference/commands/object_exist/name_column.log doc/source/example/reference/commands/object_exist/usage.log doc/source/reference/commands/object_exist.rst Added: doc/source/example/reference/commands/object_exist/name_column.log (+8 -0) 100644 =================================================================== --- /dev/null +++ doc/source/example/reference/commands/object_exist/name_column.log 2015-08-07 17:23:18 +0900 (ffd560f) @@ -0,0 +1,8 @@ +Execution example:: + + table_create Logs TABLE_NO_KEY + # [[0, 1337566253.89858, 0.000355720520019531], true] + column_create Logs timestamp COLUMN_SCALAR Time + # [[0, 1337566253.89858, 0.000355720520019531], true] + object_exist Logs.timestamp + # [[0, 1337566253.89858, 0.000355720520019531], true] Added: doc/source/example/reference/commands/object_exist/usage.log (+8 -0) 100644 =================================================================== --- /dev/null +++ doc/source/example/reference/commands/object_exist/usage.log 2015-08-07 17:23:18 +0900 (081b1dd) @@ -0,0 +1,8 @@ +Execution example:: + + object_exist Users + # [[0, 1337566253.89858, 0.000355720520019531], false] + table_create Users TABLE_HASH_KEY ShortText + # [[0, 1337566253.89858, 0.000355720520019531], true] + object_exist Users + # [[0, 1337566253.89858, 0.000355720520019531], true] Added: doc/source/reference/commands/object_exist.rst (+90 -0) 100644 =================================================================== --- /dev/null +++ doc/source/reference/commands/object_exist.rst 2015-08-07 17:23:18 +0900 (92e505a) @@ -0,0 +1,90 @@ +.. -*- rst -*- + +.. highlightlang:: none + +.. groonga-command +.. database: commands_object_exist + +``object_exist`` +================ + +Summary +------- + +.. versionadded:: 5.0.6 + +``object_exist`` returns whether object with the specified name exists +or not in database. + +It's a light operation. It just checks existence of the name in the +database. It doesn't load the specified object from disk. + +``object_exist`` doesn't check object type. The existing object may be +table, column, function and so on. + +Syntax +------ + +``object_exist`` has only one required parameter:: + + object_exist name + +Usage +----- + +You can check whether the name is already used in database: + +.. groonga-command +.. include:: ../../example/reference/commands/object_exist/usage.log +.. object_exist Users +.. table_create Users TABLE_HASH_KEY ShortText +.. object_exist Users + +The ``object_exist Users`` returns ``false`` before we create +``Users`` table. + +The ``object_exist Users`` returns ``true`` after we create ``Users`` +table. + +Parameters +---------- + +This section describes all parameters. + +Required parameters +^^^^^^^^^^^^^^^^^^^ + +There is only one required parameters. + +.. _object-exist-name: + +``name`` +"""""""" + +Specifies the object name to be checked. + +If you want to check existence of a column, use +``TABLE_NAME.COLUMN_NAME`` format like the following: + +.. groonga-command +.. include:: ../../example/reference/commands/object_exist/name_column.log +.. table_create Logs TABLE_NO_KEY +.. column_create Logs timestamp COLUMN_SCALAR Time +.. object_exist Logs.timestamp + +``Logs`` is table name and ``timestamp`` is column name in +``Logs.timestamp``. + +Return value +------------ + +The command returns ``true`` as body if object with the specified name +exists in database such as:: + + [HEADER, true] + +The command returns ``false`` otherwise such as:: + + [HEADER, false] + +See :doc:`/reference/command/output_format` for ``HEADER``. -------------- next part -------------- HTML����������������������������...Download