CONNECT Table Types - OEM: Implemented in an External LIB
Although CONNECT provides a rich set of table types, specific applications may need to access data organized in a way that is not handled by its existing foreign data wrappers (FDW). To handle these cases, CONNECT features an interface that enables developers to implement in C++ the required table wrapper and use it as if it were part of the standard CONNECT table type list. CONNECT can use these additional handlers providing the corresponding external module (dll or shared lib) be available.
To create such a table on an existing handler, use a Create Table statement as shown below.
create table xtab (column definitions) engine=CONNECT table_type=OEM module='libname' subtype='MYTYPE' [standard table options] Option_list='Myopt=foo';
The option module gives the name of the DLL or shared library implementing the OEM wrapper for the table type. This library must be located in the plugin directory like all other plugins or UDF’s.
This library must export a function GetMYTYPE. The option subtype enables CONNECT to have the name of the exported function and to use the new table type. Other options are interpreted by the OEM type and can also be specified within the option_list option.
Column definitions can be unspecified only if the external wrapper is able to return this information. For this it must export a function ColMYTYPE returning these definitions in a format acceptable by the CONNECT discovery function.
Which and how options must be specified and the way columns must be defined may vary depending on the OEM type used and should be documented by the OEM type implementer(s).
An OEM Table Example
The OEM table REST described in Adding the REST Feature as a Library Called by an OEM Table permits using REST-like tables with MariaDB binary distributions containing but not enabling the REST table type
Of course, the mongo (dll or so) exporting the GetREST and colREST functions must be available in the plugin directory for all this to work.
Some Currently Available OEM Table Modules and Subtypes
|A sample OEM wrapper displaying a one line table saying “Hello world”
|Enables using tables based on MongoDB collections.
|Handles files having the Windev HyperFile format.
|Handles Open Financial Connectivity files.
|Handles Quicken Interchange Format files.
|Handles CDR's from Cirpack UTP's.
|Access tables from the PlugDB DBMS.
How to implement an OEM handler is out of the scope of this document.