Symisc Vedis

An Embeddable Datastore Engine



Vedis C/C++ API Reference - DBM Methods.

Syntax

int unqlite_kv_config(unqlite *pStore,int iOp,...);


Configure the underlying Key/Value (KV) storage engine.


Description


This routine is used to configure the underlying KV storage engine (i.e. Hash, B+Tree, R+Tree, Mem) with various configuration commands.


The second argument to vedis_kv_config() is an integer configuration option that determines what property of the underlying KV engine is to be configured. Subsequent arguments vary depending on the configuration option in the second argument. Here is the list of allowed commands:


Commands
Expected Arguments
Description
VEDIS_KV_CONFIG_HASH_FUNC
One Argument:

unsigend int (*xHash)(

const void  *pKey,

     unsigned int nLen

)

Specify a hash function to be used instead of the built-in hash function. This option accepts a single argument which is a pointer to the client hash function.

Note that the built-in hash function (DJB) is recommended for most purposes.

VEDIS_KV_CONFIG_CMP_FUNC One Argument:

int (*xCmp)(

const void  *pUserKey,

const void  *pRecordKey,

     unsigned int nLen

)

Specify a comparison function to be used instead of the built-in comparison function. This option accepts a single argument which is a pointer to the client comparison function.

Note that the built-in comparison function (Tuned memcmp() implementation) is recommended for most purposes.


Parameters


pStore

Vedis datastore handle.

  iOp

An integer configuration option that determines what property of the JX9 virtual machine is to be configured.


Return value


VEDIS_OK is returned on success. Any other return value indicates failure such as:


VEDIS_UNKNOWN: Unknown configuration verb.


VEDIS_NOTIMPLEMENTED: The underlying KV storage engine does not implement the xConfig() method.


See also


vedis_kv_append, vedis_kv_fetch, vedis_kv_store, vedis_open, vedis_close, vedis_config.



Symisc Systems
Copyright © Symisc Systems