All Projects → dolphindb → DolphinDBPlugin

dolphindb / DolphinDBPlugin

Licence: Apache-2.0 License
No description or website provided.

Programming Languages

C++
36643 projects - #6 most used programming language
c
50402 projects - #5 most used programming language
python
139335 projects - #7 most used programming language
CMake
9771 projects
Thrift
134 projects
shell
77523 projects

Projects that are alternatives of or similar to DolphinDBPlugin

db.rstudio.com
Website dedicated to all things R and Databases
Stars: ✭ 13 (-60.61%)
Mutual labels:  odbc
sack.vfs
Node addon which adds a virtual file system interface; websockets; json(6) parsing; sql support(sqlite,odbc); javascript sched_yield; ssl certificate generation; more...
Stars: ✭ 29 (-12.12%)
Mutual labels:  odbc
python-isal
Faster zlib and gzip compatible compression and decompression by providing python bindings for the isa-l library.
Stars: ✭ 21 (-36.36%)
Mutual labels:  zlib
vbz compression
VBZ compression plugin for nanopore signal data
Stars: ✭ 31 (-6.06%)
Mutual labels:  hdf5
qt-sql-example
Example Qt application that connects to SQL Server and displays a table from the database
Stars: ✭ 29 (-12.12%)
Mutual labels:  odbc
deflate-rs
An implementation of a DEFLATE encoder in rust
Stars: ✭ 47 (+42.42%)
Mutual labels:  zlib
zlib
Compression and decompression in the gzip and zlib formats
Stars: ✭ 32 (-3.03%)
Mutual labels:  zlib
zopflipy
A Python bindings for Zopfli
Stars: ✭ 17 (-48.48%)
Mutual labels:  zlib
woss-ns3
WOSS is a multi-threaded C++ framework that permits the integration of any existing underwater channel simulator that expects environmental data as input and provides as output a channel realization. Currently, WOSS integrates the Bellhop ray-tracing program. Thanks to its automation the user only has to specify the location in the world and the…
Stars: ✭ 20 (-39.39%)
Mutual labels:  hdf5
readgssi
python tool to read and plot Geophysical Survey Systems Incorporated (GSSI) radar data
Stars: ✭ 46 (+39.39%)
Mutual labels:  hdf5
Examples
Smaller or bigger examples that I've written or will write in the future in C++.
Stars: ✭ 14 (-57.58%)
Mutual labels:  zlib
HDF5 utils
my own Fortran high level interface for HDF5
Stars: ✭ 26 (-21.21%)
Mutual labels:  hdf5
ccxx
This is a cross-platform library software library about c, c ++, unix4, posix. Include gtest, benchmark, cmake, process lock, daemon, libuv, lua, cpython, re2, json, yaml, mysql, redis, opencv, qt, lz4, oci ... https://hub.docker.com/u/oudream
Stars: ✭ 31 (-6.06%)
Mutual labels:  odbc
flowtorch
flowTorch - a Python library for analysis and reduced-order modeling of fluid flows
Stars: ✭ 47 (+42.42%)
Mutual labels:  hdf5
kobopatch-patches
Patches for use with kobopatch.
Stars: ✭ 134 (+306.06%)
Mutual labels:  zlib
api python3
No description or website provided.
Stars: ✭ 36 (+9.09%)
Mutual labels:  dolphindb
oledb
A small promised based module which uses edge.js to connect to an OLE DB, ODBC or SQL database.
Stars: ✭ 28 (-15.15%)
Mutual labels:  odbc
ODBC.jl
An ODBC interface for the Julia programming language
Stars: ✭ 81 (+145.45%)
Mutual labels:  odbc
conduit
Simplified Data Exchange for HPC Simulations
Stars: ✭ 114 (+245.45%)
Mutual labels:  hdf5
odbc-rs
Rust ODBC FFI binding
Stars: ✭ 90 (+172.73%)
Mutual labels:  odbc

DolphinDB Plugin

DolphinDB database supports dynamic loading of external plugins to extend system functionality. The plug-in can be written in C++, and it needs to be compiled into ".so" shared libraries or ".dll" shared library files.

Directory Structures

  • includeThe directory contains the class declarations and some tool class declarations for the core data structures of DolphinDB. These classes are important basic tools for implementing plug-ins.
  • demoThe directory contains a demo plug-in implementation.
  • odbcThe directory contains an implementation of the odbc plugin.

Loading Plugin

Load via function loadPlugin

Use the loadPlugin function to load external plug-ins. This function accepts a file path, which describes the format of the plug-in, for example:

loadPlugin("/YOUR_SEVER_PATH/plugins/odbc/PluginODBC.txt");

DolphinDB Server 1.20.x version can be automatically loaded through the preloadModules parameter

The premise is that the DolphinDB server version>=1.20; the plug-in that needs to be pre-loaded should exist. Otherwise, there will be an exception when the sever starts. Multiple plug-ins are easy to separate by ','.

preloadModules=plugins::mysql,plugins::odbc

DolphinDB Plugin Format

DolphinDB uses a text file to describe the plugin. The file format is as follows: The first line describes the plug-in name and shared library file name.
Each of the following lines describes the mapping between a shared library function and the DolphinDB function.

module name, lib file
function name in lib, function name in DolphinDB, function type, minParamCount, maxParamCount, isAggregated
...

Explanation

  • module name: plugin module name
  • lib file: shared library file name
  • function name in lib: the function name in the shared library
  • function name in DolphinDB: corresponding function name in DolphinDB
  • function type: operator or system
  • minParamCount: the minimum number of parameters
  • maxParamCount: the maximum number of parameters
  • isAggregated: whether it is an aggregate function

Example

PluginDemo.txt:

demo,libPluginDemo.so 
minmax,minmax,operator,1,1,0
foo,foo,system,1,1,0

The description file above defines a plugin named demo. The shared library file is named libPluginDemo.so.

The plug-in exports two functions. The first function is named minmax. The name of the function is also minmax in DolphinDB. The function type is "operator" and accepts one parameter. The second function name is echo, the name in DolphinDB is also echo, the function type is "system" and accepts one argument.

After finishing the description file, you can start writing plugins. For content, please refer to demo folder contents.

The compiler needs to use DolphinDB's core library libDolphinDB.so, which implements the classes declared in include directories.

cd demo
g++ -DLINUX -fPIC -c src/Demo.cpp -I../include -o Demo.o
g++ -fPIC -shared -o libPluginDemo.so Demo.o -lDolphinDB

After successful compilation, a shared library file named libPluginDemo.so will be generated under the directory.

Enter the following command in the DolphinDB console to load the plugin and use it.

>loadPlugin(Path to PluginDemo.txt); // Load the plugin
(minmax,echo)
>use demo; // Import the plugin's namespace
>demo::minmax([12,3,4]); // You can also use minmax([12,3,4])
[3,12]
>demo::echo("foo");
foo
>echo(1);
1

For examples of implementation of more complex plugins please refer to the odbc directory.

Tips

  • We recommend that you use the command ld to check if the compiler link is successful and if there are undefined references in the so. If the command ld generates an error, then DolphinDB can not load the plug-in correctly.
  • If the program crashes after loading the plug-in, try the following steps:
    1. Make sure that the include headers are consistent with the libDolphinDB.so implementation.
    2. Make sure that the version of gcc used to compile the plugin is consistent with the version of ``libBoardDB.so``` in order to avoid the incompatibilities between different versions of the compiler ABI.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].