Typedefs | |
typedef uint_fast64_t | mdbx_attr_t |
Functions | |
LIBMDBX_API int | mdbx_cursor_put_attr (MDBX_cursor *cursor, MDBX_val *key, MDBX_val *data, mdbx_attr_t attr, MDBX_put_flags_t flags) |
LIBMDBX_API int | mdbx_put_attr (MDBX_txn *txn, MDBX_dbi dbi, MDBX_val *key, MDBX_val *data, mdbx_attr_t attr, MDBX_put_flags_t flags) |
LIBMDBX_API int | mdbx_set_attr (MDBX_txn *txn, MDBX_dbi dbi, MDBX_val *key, MDBX_val *data, mdbx_attr_t attr) |
LIBMDBX_API int | mdbx_cursor_get_attr (MDBX_cursor *cursor, MDBX_val *key, MDBX_val *data, mdbx_attr_t *pattr, MDBX_cursor_op op) |
LIBMDBX_API int | mdbx_get_attr (MDBX_txn *txn, MDBX_dbi dbi, MDBX_val *key, MDBX_val *data, mdbx_attr_t *pattr) |
typedef uint_fast64_t mdbx_attr_t |
LIBMDBX_API int mdbx_cursor_get_attr | ( | MDBX_cursor * | cursor, |
MDBX_val * | key, | ||
MDBX_val * | data, | ||
mdbx_attr_t * | pattr, | ||
MDBX_cursor_op | op | ||
) |
Get items attribute from a database cursor.
This function retrieves key/data pairs from the database. The address and length of the key are returned in the object to which key refers (except for the case of the MDBX_SET option, in which the key object is unchanged), and the address and length of the data are returned in the object to which data refers.
[in] | cursor | A cursor handle returned by mdbx_cursor_open(). |
[in,out] | key | The key for a retrieved item. |
[in,out] | data | The data of a retrieved item. |
[out] | pattr | The pointer to retrieve attribute. |
[in] | op | A cursor operation MDBX_cursor_op. |
MDBX_NOTFOUND | No matching key found. |
MDBX_EINVAL | An invalid parameter was specified. |
LIBMDBX_API int mdbx_cursor_put_attr | ( | MDBX_cursor * | cursor, |
MDBX_val * | key, | ||
MDBX_val * | data, | ||
mdbx_attr_t | attr, | ||
MDBX_put_flags_t | flags | ||
) |
Store by cursor with attribute.
This function stores key/data pairs into the database. The cursor is positioned at the new item, or on failure usually near it.
[in] | cursor | A cursor handle returned by mdbx_cursor_open() |
[in] | key | The key operated on. |
[in] | data | The data operated on. |
[in] | attr | The attribute. |
[in] | flags | Options for this operation. This parameter must be set to 0 or one of the values described here:
|
MDBX_EKEYMISMATCH | |
MDBX_MAP_FULL | The database is full, see mdbx_env_set_mapsize(). |
MDBX_TXN_FULL | The transaction has too many dirty pages. |
MDBX_EACCES | An attempt was made to write in a read-only transaction. |
MDBX_EINVAL | an invalid parameter was specified. |
LIBMDBX_API int mdbx_get_attr | ( | MDBX_txn * | txn, |
MDBX_dbi | dbi, | ||
MDBX_val * | key, | ||
MDBX_val * | data, | ||
mdbx_attr_t * | pattr | ||
) |
Get items attribute from a database.
This function retrieves key/data pairs from the database. The address and length of the data associated with the specified key are returned in the structure to which data refers. If the database supports duplicate keys (see MDBX_DUPSORT) then the first data item for the key will be returned. Retrieval of other items requires the use of mdbx_cursor_get().
SIGSEGV
.[in] | txn | A transaction handle returned by mdbx_txn_begin(). |
[in] | dbi | A database handle returned by mdbx_dbi_open(). |
[in] | key | The key to search for in the database. |
[in,out] | data | The data corresponding to the key. |
[out] | pattr | The pointer to retrieve attribute. |
MDBX_NOTFOUND | The key was not in the database. |
MDBX_EINVAL | An invalid parameter was specified. |
LIBMDBX_API int mdbx_put_attr | ( | MDBX_txn * | txn, |
MDBX_dbi | dbi, | ||
MDBX_val * | key, | ||
MDBX_val * | data, | ||
mdbx_attr_t | attr, | ||
MDBX_put_flags_t | flags | ||
) |
Store items and attributes into a database.
This function stores key/data pairs in the database. The default behavior is to enter the new key/data pair, replacing any previously existing key if duplicates are disallowed.
[in] | txn | A transaction handle returned by mdbx_txn_begin(). |
[in] | dbi | A database handle returned by mdbx_dbi_open(). |
[in] | key | The key to store in the database. |
[in] | attr | The attribute to store in the database. |
[in,out] | data | The data to store. |
[in] | flags | Special options for this operation. This parameter must be set to 0 or by bitwise OR'ing together one or more of the values described here:
|
MDBX_KEYEXIST | |
MDBX_MAP_FULL | The database is full, see mdbx_env_set_mapsize(). |
MDBX_TXN_FULL | The transaction has too many dirty pages. |
MDBX_EACCES | An attempt was made to write in a read-only transaction. |
MDBX_EINVAL | An invalid parameter was specified. |
LIBMDBX_API int mdbx_set_attr | ( | MDBX_txn * | txn, |
MDBX_dbi | dbi, | ||
MDBX_val * | key, | ||
MDBX_val * | data, | ||
mdbx_attr_t | attr | ||
) |
Set items attribute from a database.
This function stores key/data pairs attribute to the database.
[in] | txn | A transaction handle returned by mdbx_txn_begin(). |
[in] | dbi | A database handle returned by mdbx_dbi_open(). |
[in] | key | The key to search for in the database. |
[in] | data | The data to be stored or NULL to save previous value. |
[in] | attr | The attribute to be stored. |
MDBX_NOTFOUND | The key-value pair was not in the database. |
MDBX_EINVAL | An invalid parameter was specified. |