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