Data Operations Data Types
This section defines the data types used by the functions described in this appendix.
kv_depth_enum
typedef enum {
KV_DEPTH_DEFAULT = 0,
KV_DEPTH_CHILDREN_ONLY,
KV_DEPTH_DESCENDANTS_ONLY,
KV_DEPTH_PARENT_AND_CHILDREN,
KV_DEPTH_PARENT_AND_DESCENDANTS
} kv_depth_enum;
Used with multiple-key and iterator operations to specify whether to select (return or operate on) the key-value pair for the parent key, and the key-value pairs for only immediate children or all descendants.
Options are:
-
KV_DEPTH_DEFAULT
No depth constraints are placed on the operation.
-
KV_DEPTH_CHILDREN_ONLY
Select only immediate children, do not select the parent.
-
KV_DEPTH_DESCENDANTS_ONLY
Select all descendants, do not select the parent.
-
KV_DEPTH_PARENT_AND_CHILDREN
Select immediate children and the parent.
-
KV_DEPTH_PARENT_AND_DESCENDANTS
Select all descendants and the parent.
kv_direction_enum
typedef enum {
KV_DIRECTION_FORWARD,
KV_DIRECTION_REVERSE,
KV_DIRECTION_UNORDERED
} kv_direction_enum;
Used with iterator operations to specify the order that keys are returned.
-
KV_DIRECTION_FORWARD
Iterate in ascending key order.
-
KV_DIRECTION_REVERSE
Iterate in descending key order.
-
KV_DIRECTION_UNORDERED
Iterate in no particular key order.
kv_presence_enum
typedef enum {
KV_IF_DONTCARE = 0,
KV_IF_ABSENT,
KV_IF_PRESENT
} kv_presence_enum;
Defines under what circumstances a Key/Value record will be put into the store if kv_put_with_options() is in use.
-
KV_IF_DONTCARE
The record is put into the store without constraint.
-
KV_IF_ABSENT
Put the record into the store only if a value for the the supplied key does not currently exist in the store.
-
KV_IF_PRESENT
Put the record into the store only if a value for the supplied key does currently exist in the store.
kv_return_value_version_enum
typedef enum {
KV_RETURN_VALUE_NONE = 0,
KV_RETURN_VALUE_ALL,
KV_RETURN_VALUE_VALUE,
KV_RETURN_VALUE_VERSION
} kv_return_value_version_enum;
Used with put and delete operations to define what to return as part of the operations.
-
KV_RETURN_VALUE_NONE
Do not return the value or the version.
-
KV_RETURN_VALUE_ALL
Return both the value and the version.
-
KV_RETURN_VALUE_VALUE
Return the value only.
-
KV_RETURN_VALUE_VERSION
Return the version only.