installPlugin
Syntax
installPlugin(pluginName, [pluginVersion], [pluginServerAddr])
Details
Download and extract the shared library and the description file (.txt) of the specified plugin into your DolphinDB plugins directory. It returns the full path of the installed plugin description file, which is required when loading the plugin.
To access the plugin repository via a proxy, configure the corresponding
environment variables in the system. The installPlugin function
will automatically read these settings.
- For HTTP addresses, set the
http_proxy. - For HTTPS addresses, set the
https_proxy. - Proxy URL format:
http(s)://user:password@proxyHost:proxyPort.
Parameters
pluginName is a string indicating the plugin name.
pluginVersion (optional) is a string indicating the plugin version to install. If it is not specified, the latest version will be installed.
pluginServerAddr (optional) is a string specifying the HTTP or HTTPS address of the DolphinDB plugins repository that the system should use. If not specified, the default HTTP address is used: "http://plugins.dolphindb.cn/plugins". HTTPS address is also supported: "https://plugins.dolphindb.cn/plugins". If the DolphinDB server is deployed outside Chinese Mainland, it is recommended to specify it as "http://plugins.dolphindb.com/plugins" or "https://plugins.dolphindb.com/plugins".
Returns
It returns a STRING scalar indicating the full path of the installed plugin description file.
Examples
Example 1. Download the mysql plugin on Linux:
loadPlugin("/home/DolphinDB_Linux64_V2.00.10/server/plugins/mysql/PluginMySQL.txt")
// Or
loadPlugin("mysql")
// output: /home/DolphinDB_Linux64/server/plugins/mysql/PluginMySQL.txt
Load the plugin via loadPlugin:
loadPlugin("/home/DolphinDB_Linux64/server/plugins/mysql/PluginMySQL.txt")
// Or you can use plugin name to load the plugin.
loadPlugin("mysql")
Example 2. Download plugins via a proxy on Linux.
Set the proxy address environment variable:
# replace the username, password, IP address, and port with your actual proxy configuration
# set http_proxy
export http_proxy=http://admin:123456@127.0.0.1:8888
# or set https_proxy
export https_proxy=https://admin:123456@127.0.0.1:8888
Download the specified plugin. The installPlugin
function will automatically read the proxy address environment variable and access
the plugin repository via the proxy.
installPlugin("mysql")
// output: /home/DolphinDB_Linux64_V3.00.6/server/plugins/mysql/PluginMySQL.txt
Related functions: listRemoteLists, loadPlugin
