| 1 |
.. -*- rst -*- |
| 2 |
|
| 3 |
.. groonga-command |
| 4 |
.. database: commands_reference_release |
| 5 |
|
| 6 |
``reference_release`` |
| 7 |
===================== |
| 8 |
|
| 9 |
Summary |
| 10 |
------- |
| 11 |
|
| 12 |
.. versionadded:: 10.0.4 |
| 13 |
|
| 14 |
``reference_release`` releases a reference of target objects acquired |
| 15 |
by :doc:`reference_acquire`. |
| 16 |
|
| 17 |
This command is meaningless unless you use the reference count |
| 18 |
mode. You can enable the reference count mode by the |
| 19 |
``GRN_ENABLE_REFERENCE_COUNT=yes`` environment variable. |
| 20 |
|
| 21 |
You must call a corresponding ``reference_release`` for a |
| 22 |
:doc:`reference_acquire` call. If you forget to call |
| 23 |
``reference_release``, target objects by :doc:`reference_acquire` |
| 24 |
are never closed automatically. |
| 25 |
|
| 26 |
Syntax |
| 27 |
------ |
| 28 |
|
| 29 |
This command takes two parameters. |
| 30 |
|
| 31 |
All parameters are optional:: |
| 32 |
|
| 33 |
reference_release [target_name=null] |
| 34 |
[recursive=yes] |
| 35 |
|
| 36 |
Usage |
| 37 |
----- |
| 38 |
|
| 39 |
Here is a schema definition to show usage: |
| 40 |
|
| 41 |
.. groonga-command |
| 42 |
.. include:: ../../example/reference/commands/reference_release/schema.log |
| 43 |
.. table_create Users TABLE_HASH_KEY ShortText |
| 44 |
.. column_create Users age COLUMN_SCALAR UInt8 |
| 45 |
.. column_create Users introduction COLUMN_SCALAR ShortText |
| 46 |
.. |
| 47 |
.. table_create Ages TABLE_PAT_KEY UInt8 |
| 48 |
.. column_create Ages user_age COLUMN_INDEX Users age |
| 49 |
|
| 50 |
You must call ``reference_release`` with the same arguments as |
| 51 |
corresponding :doc:`reference_acquire`. |
| 52 |
|
| 53 |
If you call :doc:`reference_acquire` with ``--target_name |
| 54 |
Users --recursive dependent``, you must call ``reference_release`` |
| 55 |
with ``--target_name Users --recursive dependent``: |
| 56 |
|
| 57 |
.. groonga-command |
| 58 |
.. include:: ../../example/reference/commands/reference_release/same_arguments.log |
| 59 |
.. reference_release --target_name Users --recursive dependent |
| 60 |
.. # select Users ... |
| 61 |
.. # load --table Users ... |
| 62 |
.. reference_release --target_name Users --recursive dependent |
| 63 |
|
| 64 |
Parameters |
| 65 |
---------- |
| 66 |
|
| 67 |
This section describes all parameters. |
| 68 |
|
| 69 |
Required parameters |
| 70 |
^^^^^^^^^^^^^^^^^^^ |
| 71 |
|
| 72 |
There is no required parameter. |
| 73 |
|
| 74 |
Optional parameters |
| 75 |
^^^^^^^^^^^^^^^^^^^ |
| 76 |
|
| 77 |
There are optional parameters. |
| 78 |
|
| 79 |
.. _reference-release-target-name: |
| 80 |
|
| 81 |
``target_name`` |
| 82 |
""""""""""""""" |
| 83 |
|
| 84 |
Specifies a target object name. Target object is one of database, |
| 85 |
table or column. |
| 86 |
|
| 87 |
If you omit this parameter, database is the target object: |
| 88 |
|
| 89 |
.. groonga-command |
| 90 |
.. include:: ../../example/reference/commands/reference_release/target_name_database.log |
| 91 |
.. reference_release |
| 92 |
|
| 93 |
If you specify a table name, the table is the target object: |
| 94 |
|
| 95 |
.. groonga-command |
| 96 |
.. include:: ../../example/reference/commands/reference_release/target_name_table.log |
| 97 |
.. reference_release --target_name Users |
| 98 |
|
| 99 |
If you specify a column name, the column is the target object: |
| 100 |
|
| 101 |
.. groonga-command |
| 102 |
.. include:: ../../example/reference/commands/reference_release/target_name_column.log |
| 103 |
.. reference_release --target_name Users.age |
| 104 |
|
| 105 |
.. _reference-release-recursive: |
| 106 |
|
| 107 |
``recursive`` |
| 108 |
""""""""""""" |
| 109 |
|
| 110 |
Specifies whether child objects of the target object are also target |
| 111 |
objects. |
| 112 |
|
| 113 |
See :ref:`reference-acquire-recursive` for details. |
| 114 |
|
| 115 |
Return value |
| 116 |
------------ |
| 117 |
|
| 118 |
The command returns ``true`` as body on success such as:: |
| 119 |
|
| 120 |
[HEADER, true] |
| 121 |
|
| 122 |
If the command fails, error details are in ``HEADER``. |
| 123 |
|
| 124 |
See :doc:`/reference/command/output_format` for ``HEADER``. |