NAV c-treeDB API Callbacks

The FairCom DB API Navigational (NAV) API is an easy-to-use database programming interface hiding many tedious underlying details. There are over twenty callbacks available throughout this API stack available from a single ctdbSetCallback() API. These are positioned at strategic control points during Session, Database, Table, and Record operations.

In addition, nearly ten field-specific callbacks can be set with ctdbSetFieldCallback(). The most common use for these has been transforming non-conforming data back and forth into the FairCom DB SQL layer. Dates and times are notorious for widely varying storage formats. SQL demands a specific schema definition. NAV callbacks allow a seamless SQL experience over legacy data formats.

Note: Only available in the C API.

See:

 

c-treeDB API Functions for User-Defined Hot Alter Table Field Conversion Callback

FairCom DB now supports passing the name of a shared library and name of a field conversion function to the hot alter table function. This permits application developers to set a user-defined field conversion function to convert field values from one version of a schema to another version.

We now extend our c-treeDB API to specify the conversion callback library at a table level and the callback conversion function name at a field level. If the callback library name at table level is not specified we retrieve the last one used. If no callback library has ever been specified we return an error.

c-treeDB C API Functions

ctdbSetFieldHotAlterCallbackFunction() sets the field hot alter table callback function.


CTDBRET ctdbDECL ctdbSetFieldHotAlterCallbackFunction(CTHANDLE Handle, pTEXT functionName)
Parameters: Handle [IN]*
Field handle **
funtionName [IN]* The name of the function in the library specified in the table handle**
Returns: CTDBRET_OK on success

ctdbSetTableHotAlterCallbackLib() sets the callback library name for hot alter table

CTBOOL ctdbDECL ctdbSetTableHotAlterCallbackLib(CTHANDLE Handle, pTEXT libName)
Parameters: Handle [IN]
Table handle.*
libName [IN]
Libarary name**
Returns: c-treeDB YES or NO

ctdbGetTableHotAlterCallbackLib() returns the callback library name for hot alter table

pTEXT ctdbDECL ctdbGetTableHotAlterCallbackLib(CTHANDLE Handle)
Parameters: Handle [IN]
Table handle.*
Returns: pointer to the internal library name buffer