loadPlugin

Syntax

loadPlugin(metaFile)

Arguments

metaFile is a string indicating the path of a text file that describes a DolphinDB plugin.

Details

Load a plugin into DolphinDB. It must be executed by a logged-in user.

For each DolphinDB plugin, there is a text file that describes the plugin. The first line of the text file includes the names of the plugin and the shared library file, separated by comma ",". Each of the following lines includes the following information: a function in the library file, the corresponding DolphinDB function, function type (operator or system function), the minimal number of parameters, the maximum number of parameters, whether the function is an aggregate function.

The function returns a tuple with the names of the functions in the library file.

Examples

The description file odbc.cfg of the DolphinDB odbc plugin:
odbc,libODBC.dll
odbcQuery,query,system,2,3,0
odbcConnect,connect,system,1,1,0
odbcClose,close,system,1,1,0
odbcExecute,execute,system,2,3,0

The odbc plugin provides 4 methods, query, connect, close andexecute. Install the plugin to use these methods. The following script shows how to load the odbc plugin and call its methods:

loadPlugin("/home/DolphinDB/server/plugins/odbc/odbc.cfg")
use odbc
ConnStr="Driver=MySQL;Data Source=odbc_test;Server=127.0.0.1;Uid=root;Pwd=123456;Database=odbc_test"
conn=connect(connStr)      // create connection to MySQL

t=query(conn,"select * from test")
close(conn)