Public representation of a key part definition. More...
#include <module.h>
Data Fields | ||
struct { | ||
uint32_t fieldno | ||
Index of a tuple field (zero based). | ||
uint32_t flags | ||
Flags, e.g. More... | ||
const char * field_type | ||
Type of the tuple field. | ||
const char * collation | ||
Collation name for string comparisons. | ||
const char * path | ||
JSON path to point a nested field. More... | ||
}; | ||
char | padding [BOX_KEY_PART_DEF_T_SIZE] | |
Padding to guarantee certain size across different tarantool versions. | ||
Public representation of a key part definition.
Usage: Allocate an array of such key parts, initialize each key part (call box_key_part_def_create() and set necessary fields), pass the array into box_key_def_new_v2() function.
Important: A module should call box_key_part_def_create() to initialize the structure with default values. There is no guarantee that all future default values for fields and flags will be remain the same.
The idea of separation from internal "struct key_part_def" is to provide stable API and ABI for modules.
New fields may be added into the end of the structure in later tarantool versions. Also new flags may be introduced within flags field. collation cannot be changed to a union (to reuse for some other value), because it is verified even for a non-string key part by box_key_def_new_v2().
Fields that are unknown at given tarantool version are ignored in general, but filled with zeros when initialized.
uint32_t PACKED::flags |
Flags, e.g.
nullability.
const char* PACKED::path |
JSON path to point a nested field.
Example:
tuple: [1, {"foo": "bar"}] key parts: [ { "fieldno": 2, "type": "string", "path": "foo" } ]
=> key: ["bar"]
Note: When the path is given, field_type means type of the nested field.