7.3.45. object_list — Groonga v16.1.0 documentation

Skip to main content
`Ctrl`+`K`

# 7.3.45. `object_list`

## 7.3.45.1. Summary

Added in version 6.0.7.

`object_list` lists objects in database. Object information is taken from metadata in database. `object_list` doesn’t open any objects. So `object_list` is a light command for database that has many tables and/or columns.

Normally, schema is a useful command than `object_list`. Because schema returns more information than `object_list`.

## 7.3.45.2. Syntax

This command takes no parameters:

    object_list

## 7.3.45.3. Usage

Here is an example schema to show example output:

Execution example:

    table_create Memos TABLE_HASH_KEY ShortText
    # [[0,1337566253.89858,0.000355720520019531],true]
    column_create Memos content COLUMN_SCALAR Text
    # [[0,1337566253.89858,0.000355720520019531],true]
    table_create Terms TABLE_PAT_KEY ShortText \
      --default_tokenizer TokenBigram \
      --normalizer NormalizerAuto
    # [[0,1337566253.89858,0.000355720520019531],true]
    column_create Terms memos_content_index \
      COLUMN_INDEX|WITH_POSITION \
      Memos content
    # [[0,1337566253.89858,0.000355720520019531],true]

Here is an output of `object_list` command against this database:

Execution example:

    object_list
    # [
    #   [
    #     0,
    #     1337566253.89858,
    #     0.000355720520019531
    #   ],
    #   {
    #     "Object": {
    #       "id": 2,
    #       "name": "Object",
    #       "opened": false,
    #       "n_elements": 4,
    #       "type": {
    #         "id": 32,
    #         "name": "type"
    #       },
    #       "flags": {
    #         "value": 0,
    #         "names": "KEY_UINT"
    #       },
    #       "path": null,
    #       "size": 8
    #     },
    #     "Bool": {
    #       "id": 3,
    #       "name": "Bool",
    #       "opened": false,
    #       "n_elements": 4,
    #       "type": {
    #         "id": 32,
    #         "name": "type"
    #       },
    #       "flags": {
    #         "value": 0,
    #         "names": "KEY_UINT"
    #       },
    #       "path": null,
    #       "size": 1
    #     },
    #     "Int8": {
    #       "id": 4,
    #       "name": "Int8",
    #       "opened": false,
    #       "n_elements": 4,
    #       "type": {
    #         "id": 32,
    #         "name": "type"
    #       },
    #       "flags": {
    #         "value": 8,
    #         "names": "KEY_INT"
    #       },
    #       "path": null,
    #       "size": 1
    #     },
    #     "UInt8": {
    #       "id": 5,
    #       "name": "UInt8",
    #       "opened": false,
    #       "n_elements": 4,
    #       "type": {
    #         "id": 32,
    #         "name": "type"
    #       },
    #       "flags": {
    #         "value": 0,
    #         "names": "KEY_UINT"
    #       },
    #       "path": null,
    #       "size": 1
    #     },
    #     "Int16": {
    #       "id": 6,
    #       "name": "Int16",
    #       "opened": false,
    #       "n_elements": 4,
    #       "type": {
    #         "id": 32,
    #         "name": "type"
    #       },
    #       "flags": {
    #         "value": 8,
    #         "names": "KEY_INT"
    #       },
    #       "path": null,
    #       "size": 2
    #     },
    #     "UInt16": {
    #       "id": 7,
    #       "name": "UInt16",
    #       "opened": false,
    #       "n_elements": 4,
    #       "type": {
    #         "id": 32,
    #         "name": "type"
    #       },
    #       "flags": {
    #         "value": 0,
    #         "names": "KEY_UINT"
    #       },
    #       "path": null,
    #       "size": 2
    #     },
    #     "Int32": {
    #       "id": 8,
    #       "name": "Int32",
    #       "opened": false,
    #       "n_elements": 4,
    #       "type": {
    #         "id": 32,
    #         "name": "type"
    #       },
    #       "flags": {
    #         "value": 8,
    #         "names": "KEY_INT"
    #       },
    #       "path": null,
    #       "size": 4
    #     },
    #     "UInt32": {
    #       "id": 9,
    #       "name": "UInt32",
    #       "opened": false,
    #       "n_elements": 4,
    #       "type": {
    #         "id": 32,
    #         "name": "type"
    #       },
    #       "flags": {
    #         "value": 0,
    #         "names": "KEY_UINT"
    #       },
    #       "path": null,
    #       "size": 4
    #     },
    #     "Int64": {
    #       "id": 10,
    #       "name": "Int64",
    #       "opened": false,
    #       "n_elements": 4,
    #       "type": {
    #         "id": 32,
    #         "name": "type"
    #       },
    #       "flags": {
    #         "value": 8,
    #         "names": "KEY_INT"
    #       },
    #       "path": null,
    #       "size": 8
    #     },
    #     "UInt64": {
    #       "id": 11,
    #       "name": "UInt64",
    #       "opened": false,
    #       "n_elements": 4,
    #       "type": {
    #         "id": 32,
    #         "name": "type"
    #       },
    #       "flags": {
    #         "value": 0,
    #         "names": "KEY_UINT"
    #       },
    #       "path": null,
    #       "size": 8
    #     },
    #     "Float": {
    #       "id": 12,
    #       "name": "Float",
    #       "opened": false,
    #       "n_elements": 4,
    #       "type": {
    #         "id": 32,
    #         "name": "type"
    #       },
    #       "flags": {
    #         "value": 16,
    #         "names": "KEY_FLOAT"
    #       },
    #       "path": null,
    #       "size": 8
    #     },
    #     "Time": {
    #       "id": 13,
    #       "name": "Time",
    #       "opened": false,
    #       "n_elements": 4,
    #       "type": {
    #         "id": 32,
    #         "name": "type"
    #       },
    #       "flags": {
    #         "value": 8,
    #         "names": "KEY_INT"
    #       },
    #       "path": null,
    #       "size": 8
    #     },
    #     "ShortText": {
    #       "id": 14,
    #       "name": "ShortText",
    #       "opened": false,
    #       "n_elements": 4,
    #       "type": {
    #         "id": 32,
    #         "name": "type"
    #       },
    #       "flags": {
    #         "value": 16384,
    #         "names": "KEY_VAR_SIZE"
    #       },
    #       "path": null,
    #       "size": 4096
    #     },
    #     "Text": {
    #       "id": 15,
    #       "name": "Text",
    #       "opened": false,
    #       "n_elements": 4,
    #       "type": {
    #         "id": 32,
    #         "name": "type"
    #       },
    #       "flags": {
    #         "value": 16384,
    #         "names": "KEY_VAR_SIZE"
    #       },
    #       "path": null,
    #       "size": 65536
    #     },
    #     "LongText": {
    #       "id": 16,
    #       "name": "LongText",
    #       "opened": false,
    #       "n_elements": 4,
    #       "type": {
    #         "id": 32,
    #         "name": "type"
    #       },
    #       "flags": {
    #         "value": 16384,
    #         "names": "KEY_VAR_SIZE"
    #       },
    #       "path": null,
    #       "size": 2147483648
    #     },
    #     "TokyoGeoPoint": {
    #       "id": 17,
    #       "name": "TokyoGeoPoint",
    #       "opened": false,
    #       "n_elements": 4,
    #       "type": {
    #         "id": 32,
    #         "name": "type"
    #       },
    #       "flags": {
    #         "value": 24,
    #         "names": "KEY_GEO_POINT"
    #       },
    #       "path": null,
    #       "size": 8
    #     },
    #     "WGS84GeoPoint": {
    #       "id": 18,
    #       "name": "WGS84GeoPoint",
    #       "opened": false,
    #       "n_elements": 4,
    #       "type": {
    #         "id": 32,
    #         "name": "type"
    #       },
    #       "flags": {
    #         "value": 24,
    #         "names": "KEY_GEO_POINT"
    #       },
    #       "path": null,
    #       "size": 8
    #     },
    #     "Float32": {
    #       "id": 19,
    #       "name": "Float32",
    #       "opened": false,
    #       "n_elements": 4,
    #       "type": {
    #         "id": 32,
    #         "name": "type"
    #       },
    #       "flags": {
    #         "value": 16,
    #         "names": "KEY_FLOAT"
    #       },
    #       "path": null,
    #       "size": 4
    #     },
    #     "BFloat16": {
    #       "id": 20,
    #       "name": "BFloat16",
    #       "opened": false,
    #       "n_elements": 4,
    #       "type": {
    #         "id": 32,
    #         "name": "type"
    #       },
    #       "flags": {
    #         "value": 16,
    #         "names": "KEY_FLOAT"
    #       },
    #       "path": null,
    #       "size": 2
    #     },
    #     "TokenMecab": {
    #       "id": 64,
    #       "name": "TokenMecab",
    #       "opened": true,
    #       "n_elements": 4,
    #       "type": {
    #         "id": 33,
    #         "name": "proc"
    #       },
    #       "flags": {
    #         "value": 4096,
    #         "names": "CUSTOM_NAME"
    #       },
    #       "path": "tokenizers/mecab.so",
    #       "plugin_id": 1
    #     },
    #     "Memos": {
    #       "id": 256,
    #       "name": "Memos",
    #       "opened": false,
    #       "n_elements": 6,
    #       "type": {
    #         "id": 48,
    #         "name": "table:hash_key"
    #       },
    #       "flags": {
    #         "value": 49152,
    #         "names": "TABLE_HASH_KEY|PERSISTENT"
    #       },
    #       "path": "${DB_PATH}.0000100",
    #       "range": {
    #         "id": 0,
    #         "name": null
    #       },
    #       "token_filters": [
    #
    #       ]
    #     },
    #     "Memos.content": {
    #       "id": 257,
    #       "name": "Memos.content",
    #       "opened": false,
    #       "n_elements": 5,
    #       "type": {
    #         "id": 65,
    #         "name": "column:var_size"
    #       },
    #       "flags": {
    #         "value": 49152,
    #         "names": "COLUMN_SCALAR|PERSISTENT"
    #       },
    #       "path": "${DB_PATH}.0000101",
    #       "range": {
    #         "id": 15,
    #         "name": "Text"
    #       },
    #       "sources": [
    #
    #       ],
    #       "generator": ""
    #     },
    #     "Terms": {
    #       "id": 258,
    #       "name": "Terms",
    #       "opened": false,
    #       "n_elements": 6,
    #       "type": {
    #         "id": 49,
    #         "name": "table:pat_key"
    #       },
    #       "flags": {
    #         "value": 49153,
    #         "names": "TABLE_PAT_KEY|PERSISTENT"
    #       },
    #       "path": "${DB_PATH}.0000102",
    #       "range": {
    #         "id": 0,
    #         "name": null
    #       },
    #       "token_filters": [
    #
    #       ]
    #     },
    #     "Terms.memos_content_index": {
    #       "id": 259,
    #       "name": "Terms.memos_content_index",
    #       "opened": false,
    #       "n_elements": 4,
    #       "type": {
    #         "id": 72,
    #         "name": "column:index"
    #       },
    #       "flags": {
    #         "value": 33282,
    #         "names": "COLUMN_INDEX|WITH_POSITION|PERSISTENT"
    #       },
    #       "path": "${DB_PATH}.0000103",
    #       "range": {
    #         "id": 256,
    #         "name": "Memos"
    #       },
    #       "sources": [
    #         {
    #           "id": 257,
    #           "name": "Memos.content"
    #         }
    #       ]
    #     }
    #   }
    # ]

## 7.3.45.4. Parameters

This section describes all parameters.

### 7.3.45.4.1. Required parameters

There is no required parameter.

### 7.3.45.4.2. Optional parameters

There is no optional parameter.

## 7.3.45.5. Return value

`object_list` command returns a list of object information in the database:

    [HEADER, OBJECTS]

### 7.3.45.5.1. `HEADER`

See Output format about `HEADER`.

### 7.3.45.5.2. `OBJECTS`

`OBJECTS` are pairs of object name and object details:

    {
      "OBJECT_1": OBJECT_1,
      "OBJECT_2": OBJECT_2,
      ...,
      "OBJECT_n": OBJECT_n,
    }

Each `OBJECT` consists of common properties and object type specific properties.

### 7.3.45.5.3. `OBJECT` (common properties)

Here are common properties:

    {
      "id":         ID,
      "name":       NAME,
      "opened":     OPENED,
      "value_size": N_BYTES,
      "n_elements": N_ELEMENTS,
      "type":       OBJECT_TYPE,
      "flags":      FLAGS,
      "path":       PATH
    }

Name | Description
--- | ---
`id` | The ID of the object.
`name` | The name of the object.
`opened` | Whether the object is opened or not. It’s `true` or `false`. If the object is opened, this value is `true`. Otherwise, this value is `false`.
`value_size` | The number of bytes of the metadata. It’s an integer. It’s appeared only when the metadata are broken. If this property is appeared, `type`, `n_elements`, `flags` and `path` aren’t appeared. Because they can’t be retrieved from broken metadata.
`n_elements` | The number of internal elements in the metadata. It’s an integer.
`type` | The type of the object. See OBJECT_TYPE for details.
`flags` | The flags of the object. See FLAGS for details.
`path` | The path that contains data of the object. It’s `null` for objects that doesn’t have data. For example, command object doesn’t have data.

### 7.3.45.5.4. `OBJECT_TYPE`

`OBJECT_TYPE` represents the type of object. For example, patricia trie table, hash table and index column are object types.

`OBJECT_TYPE` has the following properties:

    {
      "id":   ID,
      "name": NAME
    }

Name | Description
--- | ---
`id` | The ID of the type.
`name` | The name of the type. For example, TABLE_HASH_KEY is `"table:hash_key"`, Vector column is `"column:var_size"` and Index column is `"column:index"`.

### 7.3.45.5.5. `FLAGS`

`FLAGS` represents the flags of object. The most flags are the specified flags in table_create or column_create. Some flags are added internally.

`FLAGS` has the following properties:

    {
      "value": VALUE,
      "names": NAMES
    }

Name | Description
--- | ---
`value` | The value of the flags. It’s an integer.
`names` | The names of each flag. It’s a string. Each name is separated by `|` such as `TABLE_HASH_KEY|PERSISTENT`.

### 7.3.45.5.6. `OBJECT` (`"type"` object type specific properties)

Here are `"type"` object type specific properties in `OBJECT`:

    {
      "size": SIZE
    }

Name | Description
--- | ---
`size` | The size of the type. If the type is fixed size type, the size is the size of each value. If the type is variable size type, the size is the maximum size of each value.

### 7.3.45.5.7. `OBJECT` (`"proc"` object type specific properties)

Here is a list of object that is `"proc"` object type:

- Command

- Function

- Normalizers

- Tokenizers

- Token filters

Here are `"proc"` object type specific properties in `OBJECT`:

    {
      "plugin_id": PLUGIN_ID
    }

Name | Description
--- | ---
`plugin_id` | The plugin ID of the `"proc"` object. If the `"proc"` object is defined by plugin, the value is `1` or more larger integer. Plugin ID is `0` for builtin `"proc"` object.

### 7.3.45.5.8. `OBJECT` (`"table:*"` object types specific properties)

Here are `"table:*"` object types specific properties in `OBJECT`:

    {
      "range":         RANGE,
      "token_filters": TOKEN_FILTERS
    }

Name | Description
--- | ---
`range` | The type of the table’s value. See RANGE for details.
`token_filters` | The token filters of the table. See TOKEN_FILTERS for details.

### 7.3.45.5.9. `RANGE`

`RANGE` represents the type of the range.

`RANGE` has the following properties:

    {
      "id":   ID,
      "name": NAME
    }

Name | Description
--- | ---
`id` | The ID of the type of the range. It’s an integer. If the object doesn’t have range, ID is `0`.
`name` | The name of the type of the range. It’s a string or `null`. If the object doesn’t have range, name is `null`.

### 7.3.45.5.10. `TOKEN_FILTERS`

`TOKEN_FILTERS` represents the token filters of the table.

`TOKEN_FILTERS` is an array of `TOKEN_FILTER`:

    [
      TOKEN_FILTER_1,
      TOKEN_FILTER_2,
      ...,
      TOKEN_FILTER_n
    ]

`TOKEN_FILTER` has the following properties:

    {
      "id":   ID,
      "NAME": NAME
    }

Name | Description
--- | ---
`id` | The ID of the token filter. It’s an integer.
`name` | The name of the token filter. It’s a string.

### 7.3.45.5.11. `OBJECT` (`"column:*"` object types specific properties)

Here are `"column:*"` object types specific properties in `OBJECT`:

    {
      "range": RANGE,
      "sources": SOURCES
    }

Name | Description
--- | ---
`range` | The type of the column’s value. See RANGE for details.
`sources` | The sources of the index column. See SOURCES for details.

### 7.3.45.5.12. `OBJECT` (`"column:fix"` and `"column:var"` object types specific properties)

Here are `"column:fix"` and `"column:var"` object type specific properties in `OBJECT`:

    {
      "generator": GENERATOR
    }

Name | Description
--- | ---
`range` | Added in version 14.1.0. The generator expression in Script syntax. If the column is not a Generated column, this is an empty string.

### 7.3.45.5.13. `SOURCES`

`SOURCES` represents the sources of an index column or a generated column.

`SOURCES` is an array of `SOURCE`:

    [
      SOURCE_1,
      SOURCE_2,
      ...,
      SOURCE_n
    ]

`SOURCE` has the following properties:

    {
      "id":   ID,
      "NAME": NAME
    }

Name | Description
--- | ---
`id` | The ID of the source table or column. It’s an integer.
`name` | The name of the source table or column. It’s a string.

## 7.3.45.6. See also

- schema