Loading user-defined functions

After compiling your user-defined functions into a DLL, you must set the appropriate options in the database configuration object to make QDB load those functions at startup and hence, make them usable to clients through SQL queries.

To install scalar and aggregate functions, you need to specify them by using an option of the form Function::tag@library.so, where tag is the name of the function description structure and library.so is the path of the DLL containing the code, which can be an absolute or relative path within the library search path.

For the earlier example with the get_my_sort_runtime_cfg structure that referenced the get_my_sort_runtime() function, you can install this function with the following configuration option:

Function::get_my_sort_runtime_cfg@/usr/lib/libqdb_my_sort.so

To install collation routines, you need to specify them by using an option of the form Collation::tag@library.so, where tag and library.so have the same meanings as they do in a Function entry.

You can then install the collation routine represented by the my_sort_runtime_cfg structure shown in the previous example, with the following option:

Collation::my_sort_runtime_cfg@/usr/lib/libqdb_my_sort.so

Full details on all supported configuration entries are given in Database configuration objects.