system datasource service
More...
Inherits QorusSystemService.
|
| reload () |
| reload service method
|
|
Datasource | get (string name) |
| get service method
|
|
DatasourcePool | getUnique (string name) |
| getUnique service method
|
|
DatasourcePool | getPool (string name) |
| getPool service method
|
|
Datasource | getDedicated (string name) |
| getDedicated service method
|
|
nothing | update_hash (string name, hash h) |
| update_hash service method
|
|
nothing | update_string (string name, string desc) |
| update_string service method
|
|
nothing | update (string name, string type, string user, string pass, string db, *string charset, *string host, *softint port, softint min=0, softint max=0, *hash opts) |
| update service method
|
|
hash | showDefaults () |
| showDefaults service method
|
|
hash | showDefaultsWithPasswords () |
| showDefaultsWithPasswords service method
|
|
nothing | reset (string name) |
| reset service method
|
|
auto | select (string name, string sql) |
| select service method
|
|
auto | selectRow (string name, string sql) |
| selectRow service method
|
|
nothing | flushToFile (*hash optHash) |
| flushToFile service method
|
|
string | get_desc (string name) |
| get_desc service method
|
|
system datasource service
◆ flushToFile()
nothing QorusSystemDatasourceService::flushToFile |
( |
*hash |
optHash | ) |
|
|
inline |
◆ get()
Datasource QorusSystemDatasourceService::get |
( |
string |
name | ) |
|
|
inline |
get service method
it is an error to close or delete the Datasource returned by this method or to turn off the autocommit status
- Parameters
-
name | the name of the datasource |
- Returns
- a shared Datasource object with autocommit turn on
- Exceptions
-
DATASOURCE-SERVICE-EXCEPTION | unknown or system datasource |
- See also
- getDedicated()
-
getPool()
- Deprecated:
- use get_datasource_pool() instead; the concept of datasources with auto-commit enabled is deprecated in Qorus
◆ get_desc()
string QorusSystemDatasourceService::get_desc |
( |
string |
name | ) |
|
|
inline |
get_desc service method
- Parameters
-
name | the name of the datasource |
- Returns
- datasource description string for the given datasource, if known, otherwise throws an exception
- Exceptions
-
DATASOURCE-ERROR | unknown datasource |
- Deprecated:
- use get_datasource_info() or GET /api/latest/remote/datasources/{name} instead
◆ getDedicated()
Datasource QorusSystemDatasourceService::getDedicated |
( |
string |
name | ) |
|
|
inline |
getDedicated service method
- Parameters
-
name | the name of the datasource |
- Returns
- a new, dedicated Datasource object, suitable for transaction management for long-running transactions
- Exceptions
-
DATASOURCE-ERROR | unknown or system datasource |
- See also
- getPool()
-
get()
- Deprecated:
- use get_datasource_dedicated() instead
◆ getPool()
DatasourcePool QorusSystemDatasourceService::getPool |
( |
string |
name | ) |
|
|
inline |
getPool service method
- Parameters
-
name | the name of the datasource |
- Returns
- a DatasourcePool object, suitable for transaction management with short transactions
- Exceptions
-
DATASOURCE-ERROR | unknown or system datasource |
- See also
- getDedicated()
-
get()
- Deprecated:
- use get_datasource_pool() instead
◆ getUnique()
DatasourcePool QorusSystemDatasourceService::getUnique |
( |
string |
name | ) |
|
|
inline |
getUnique service method
- Parameters
-
name | the name of the datasource |
- Returns
- a DatasourcePool object, suitable for transaction management with short transactions
- See also
- getPool()
- Deprecated:
- use get_datasource_pool() instead
◆ reload()
QorusSystemDatasourceService::reload |
( |
| ) |
|
|
inline |
reload service method
It is necessary to call this method (or reset the service) to re-read the configuration file
- Exceptions
-
FILELINEITERATOR-OPEN-ERROR | error opening configuration file |
◆ reset()
nothing QorusSystemDatasourceService::reset |
( |
string |
name | ) |
|
|
inline |
◆ select()
auto QorusSystemDatasourceService::select |
( |
string |
name, |
|
|
string |
sql |
|
) |
| |
|
inline |
select service method
- Parameters
-
name | the name of the datasource to execute the select on |
sql | the SQL string to execute |
- Returns
- the result of executing Datasource::selectRow() with the given arguments
- Exceptions
-
DATASOURCE-ERROR | unknown or system datasource |
- Deprecated:
- use select methods in the system.sqlutil service instead
◆ selectRow()
auto QorusSystemDatasourceService::selectRow |
( |
string |
name, |
|
|
string |
sql |
|
) |
| |
|
inline |
selectRow service method
- Parameters
-
name | the name of the datasource to execute the select on |
sql | the SQL string to execute |
- Returns
- the result of executing Datasource::selectRow() with the given arguments
- Exceptions
-
DATASOURCE-ERROR | unknown or system datasource |
- Deprecated:
- use select methods in the system.sqlutil service instead
◆ showDefaults()
hash QorusSystemDatasourceService::showDefaults |
( |
| ) |
|
|
inline |
showDefaults service method
- Returns
- a hash of datasource information, each hash value is a hash with the following possible keys (not all keys may be set on all datasources):
type:
the driver name for the datasource
user:
the username for the connection
charset:
the database-specific character set name for the connection
db:
the database name for the connection
host:
the hostname for the connection
port:
the port number for the connection
desc:
a descriptive string for the connection
locked:
True
if the datasource is locked
options:
a hash with the following 2 members: min
and max
shared-pool
: a string giving shared pool status (if any shared pool exists)
- Deprecated:
- use GET /api/remote/datasources instead
◆ showDefaultsWithPasswords()
hash QorusSystemDatasourceService::showDefaultsWithPasswords |
( |
| ) |
|
|
inline |
showDefaultsWithPasswords service method
- Returns
- a hash of datasource information, each hash value is a hash with the following possible keys (not all keys may be set on all datasources):
type:
the driver name for the datasource
user:
the username for the connection
password:
the password for the connection
charset:
the database-specific character set name for the connection
db:
the database name for the connection
host:
the hostname for the connection
port:
the port number for the connection
desc:
a descriptive string for the connection
locked:
True
if the datasource is locked
options:
a hash with the following 2 members: min
and max
shared-pool
: a string giving shared pool status (if any shared pool exists)
- Note
- - requires role OMQ::QR_DATASOURCE_CONTROL
- Deprecated:
- use GET /api/remote/datasources instead
◆ update()
nothing QorusSystemDatasourceService::update |
( |
string |
name, |
|
|
string |
type, |
|
|
string |
user, |
|
|
string |
pass, |
|
|
string |
db, |
|
|
*string |
charset, |
|
|
*string |
host, |
|
|
*softint |
port, |
|
|
softint |
min = 0 , |
|
|
softint |
max = 0 , |
|
|
*hash |
opts |
|
) |
| |
|
inline |
update service method
- Parameters
-
name | the name of the datasource to update or add |
type | the name of the driver |
user | the name of the user for connections based on this datasource |
pass | the password for connections based on this datasource |
db | the database name for connections based on this datasource |
charset | the database-specific character encoding for connections based on this datasource |
host | the optional hostname for new connections |
port | the optional port number for new connections |
min | the minimum number of connections for DatasourcePool objects created from this datasource |
max | the maximum number of connections for DatasourcePool objects created from this datasource |
opts | other driver options |
- Exceptions
-
DATASOURCE-SERVICE-EXCEPTION | unknown or system datasource |
- Note
- Changing a datasource with this method is permanent
- Deprecated:
- use PUT /api/latest/remote/datasources/{name} instead
◆ update_hash()
nothing QorusSystemDatasourceService::update_hash |
( |
string |
name, |
|
|
hash |
h |
|
) |
| |
|
inline |
update_hash service method
- Parameters
-
name | the name of the datasource to update or add |
h | a datasource hash like that returned by parse_datasource() |
- Exceptions
-
DATASOURCE-ERROR | empty name string passed as an argument or tried to update a system datasource |
- Note
- Changing a datasource with this method is permanent
- Deprecated:
- use PUT /api/latest/remote/datasources/{name} instead
◆ update_string()
nothing QorusSystemDatasourceService::update_string |
( |
string |
name, |
|
|
string |
desc |
|
) |
| |
|
inline |
update_string service method
- Parameters
-
name | the name of the datasource to update or add |
desc | a datasource description string, like: driver:user/pass@db(encoding)%host:port{min=x,max=y} |
- Exceptions
-
DATASOURCE-SERVICE-EXCEPTION | unknown or system datasource |
- Note
- Changing a datasource with this method is permanent
- Deprecated:
- use PUT /api/latest/remote/datasources/{name} instead
The documentation for this class was generated from the following file: