Qorus Integration Engine®  5.0.6_git
OMQ::QorusRawSqlStatementOutboundMapper Class Reference

Qorus oubound mapper based on raw SQL select statement. More...

Inheritance diagram for OMQ::QorusRawSqlStatementOutboundMapper:
TableMapper::RawSqlStatementOutboundMapper TableMapper::AbstractSqlStatementOutboundMapper Mapper::Mapper

Public Member Methods

hash< auto > optionKeys ()
 returns a list of valid constructor options for this class (can be overridden in subclasses) More...
 

Static Public Member Methods

static Qore::SQL::AbstractDatasource getDatasource (reference< *hash< auto >> opts)
 called in the constructor to get the Table object
 

Public Attributes

const OptionKeys
 valid mapper keys
 
const UserOptions
 valid user options
 

Detailed Description

Qorus oubound mapper based on raw SQL select statement.

Options used for SqlRawStatementOutboundMapper are:

Example of the mapper definition in the qmapper file:

# name: regression-out-sql-statement
# version: 1.0
# desc: Regression test for QorusSqlStatementOutboundMapper
# type: QorusRawSqlStatementOutboundMapper
# author: Petr Vanek (Qore Technologies, s.r.o.)
OPTION: datasource: "omquser"
OPTION: select: "select * from my_table where id = %v"
OPTION: output: ()
FIELD: "uuid_mapped" : "uuid"
FIELD: "some_const" : ("constant" : "foobar")
# END

SqlRawStatementOutboundMapper Variable Binding

When SqlRawStatementOutboundMapper is initialized it can get the bind runtime option to make sh parametrized at runtime.

Example of mapper initialization in the workflow step:

hash<auto> ropts = {"bind": 1};
SqlRawStatementOutboundMapper m = get_mapper("regression-out-sql-statement", ropts);

Then values provided in runtime options (ropts), key "bind" are passed to the mappers's select statement. Resulting in for example:

select * from my_table where id = :var_1;
-- binding 1 into :var_1

Member Function Documentation

◆ optionKeys()

hash<auto> OMQ::QorusRawSqlStatementOutboundMapper::optionKeys ( )

returns a list of valid constructor options for this class (can be overridden in subclasses)

Returns
a list of valid constructor options for this class (can be overridden in subclasses)

The documentation for this class was generated from the following file:
OMQ::UserApi::get_mapper
deprecated Mapper::Mapper get_mapper(string name, *hash< auto > rtopts)
returns the given mapper if registered for the current interface