Qore DatasourceProvider Module Reference 1.1
|
The DatasourceProvider module provides an API for providing Datasource connection strings.
To use this module, use "%requires DatasourceProvider"
in your code.
All the public symbols in the module are defined in the DatasourceProvider namespace
Functions:
This module uses the "QORE_DATASOURCE_PROVIDERS"
environment variable to load datasource provider modules. Each datasource provider module must provide two public functions; one called get_mod_ds_string()
with the following signature:
And one called get_mod_ds_hash()
returning a hash keyed by datasource name where values are datasource strings with the following signature:
For get_mod_ds_string()
, if the string argument is not a valid identifier for a datasource, the function should throw an exception (any exception; the exception is not displayed by default).
Datasource provider modules declared in the "QORE_DATASOURCE_PROVIDERS"
environment variable must be separated by the platform-specific PathSep character as in the following examples:
export QORE_DATASOURCE_PROVIDERS=MyDatasourceProvider:OtherDatasourceProvider
set QORE_DATASOURCE_PROVIDERS=MyDatasourceProvider;OtherDatasourceProvider
$env:QORE_DATASOURCE_PROVIDERS="MyDatasourceProvider;OtherDatasourceProvider"
get_ds_hash()
function