SQLamarr
The stand-alone ultra-fast simulation option for the LHCb experiment
SQLamarr.Plugin.Plugin Class Reference

Wrap an external function as defined in a compiled shared library. More...

Public Member Functions

def __init__ (self, SQLite3DB db, str library_path, str function_name, str query, str output_table, List[str] outputs, List[str] references)
 Acquire the db and configure the interface with the compiled function. More...
 

Detailed Description

Wrap an external function as defined in a compiled shared library.

Python bindings for SQLamarr::Plugin.

The C function function_name is selected from the shared object library_path and evaluated for each row obtained executing the query on the database db. Results are stored in the temporary table output_table whose columns are named after the list of outputs. The columns returned by the query are all interpreted as inputs to the external functions, unless they are listed as references, in that case they are copied to the output table, easying JOIN operations with other tables in the database.

Definition at line 29 of file Plugin.py.

Constructor & Destructor Documentation

◆ __init__()

def SQLamarr.Plugin.Plugin.__init__ (   self,
SQLite3DB  db,
str  library_path,
str  function_name,
str  query,
str  output_table,
List[str]  outputs,
List[str]   references 
)

Acquire the db and configure the interface with the compiled function.

@param db: An open database connection;
@param library_path: path-like string defining the library defining the
  function to execute;
@param function_name: string defining the name of the function to execute;
@param query: SQL query defining the input and reference columns;
@param output_table: name of the table where reference and output are
  stored;
@param outputs: list of the output column names for further reference;
@param references: list of columns selected by `query` to be used as
  reference indices instead of passing as inputs to the external function.

Definition at line 45 of file Plugin.py.


The documentation for this class was generated from the following file: