Symisc Vedis

An Embeddable Datastore Engine



Vedis C/C++ API Reference - Command execution.

Syntax

int vedis_exec_result(vedis *pStore,vedis_value **ppOut);


Extract th return value of the last executed command.


Description


Each Vedis command must return its execution result (i.e. Its return value) to the caller. This interface let you extract the object value returned by the last executed command. Use the following interfaces to cast the object value to the desired type:


vedis_value_to_int()

vedis_value_to_bool()

vedis_value_to_int64()

vedis_value_to_double()

vedis_value_to_string()


Note that calling vedis_exec() again will overwrite the return value of the last executed command. Call vedis_config() with a configuration verb set to: VEDIS_CONFIG_DUP_EXEC_VALUE for a private copy of the returned object value of the last executed command.


Parameters


pStore

Vedis datastore handle.

  ppOut

OUT: A pointer to the command return value.


Return value


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


VEDIS_ABORT Multi-threading issues (Unlikely scenario).


VEDIS_MEM Out of memory (Unlikely scenario).


For a human-readable error message, you can extract the database error log via vedis_config() with a configuration verb set to VEDIS_CONFIG_ERR_LOG.


Example


Compile this C file for a smart introduction to these interfaces.


See also


vedis_exec, vedis_config.



Symisc Systems
Copyright © Symisc Systems