Tarantool
Get your data in RAM. Get compute close to data. Enjoy the performance.
 
Loading...
Searching...
No Matches
Data Fields
PACKED Union Reference

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.
 

Detailed Description

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.

Field Documentation

◆ flags

uint32_t PACKED::flags

Flags, e.g.

nullability.

◆ path

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.


The documentation for this union was generated from the following file: