Qorus Integration Engine® Enterprise Edition 6.0.25_prod
|
Back to the Developer's Guide Table of Contents
User schema module files allow Qorus developers to manage user schemas automatically by provided a user schema module file describing the schema.
oload and schema-tool both recognize the qsm
extension and apply the configuration therein to the given schema.
When oload loads such a schema file, the schema will be automatically aligned in the target datasource as described by the user schema module. Furthermore schema-tool allows for manual schema creation and alignment as well as schema dropping of user schemas using the -V,–align-schema=ARG
and –drop-schema=ARG
options, respectively.
Qorus user schema module files are Qore user modules that use the Schema module to provide the configuration and management of user schemas.
A Qorus user schema module must have the extension qsm
and should be located in the modules
subdirectory of the user
subdirectory.
The user schema module must provide the following public (ie exported) functions:
public string sub get_datasource_name()
: this function must return the name of the datasource to be used for schema managementAbstractSchema sub get_user_schema(AbstractDatasource ds, *string dts, *string its)
: this function must return the schema object to be managed; the arguments to the function correspond to the arguments to the AbstractSchema::constructor() methodThe AbstractSchema object returned by get_user_schema()
represents the schema that will be managed.
The following is an example of a user schema module file: