These DBI functions were added in Qore 0.8.6; the original functions used camel case names and had NOOP variants (see Old DBI Functions)
Datasource Hash
Key | Description |
type | the name of the driver, if present |
user | the username given in the string |
pass | the password for the connection |
db | the database name for the connection |
charset | The name of the DB-specific character encoding to use for the connection, if present in the string |
host | the hostname for the connection, if present in the string |
port | the port number to use for the connection, if present in the string |
options | A hash of options given in the string, if present. Special options are "min" and "max" , which are respected by the DatasourcePool::constructor(hash) variant for setting the minimum and maximum connections in the pool, respectively; other options are passed to the DBI driver |
int Qore::SQL::dbi_get_driver_capabilities |
( |
string |
driver | ) |
|
Returns an integer representing the capabilities of a DBI driver binary-OR'ed together (see DBI Capability Constants) or 0 if the driver is not already loaded.
- Code Flags:
- CONSTANT
- Parameters
-
driver | the name of the driver; if the given driver is not already loaded then this function returns NOTHING |
- Returns
- an integer representing the capabilities of a DBI driver binary-OR'ed together (see DBI Capability Constants) or 0 if the driver is not already loaded
- Example:
- Note
- similar to getDBIDriverCapabilities() except uses the standard function naming scheme (ie
"names_like_this()"
instead of "camelCase()"
), always returns an int, and does not have a NOOP variant
- Since
- Qore 0.8.6
*list Qore::SQL::dbi_get_driver_capability_list |
( |
string |
driver | ) |
|
Returns a list of each capability supported by the given DBI driver (see DBI Capability Constants) or NOTHING if the driver cannot be found.
- Code Flags:
- CONSTANT
- Parameters
-
driver | the name of the driver; if the given driver is not loaded then the function returns NOTHING |
- Returns
- a list of each capability supported by the given DBI driver (see DBI Capability Constants) or NOTHING if the driver cannot be found
- Example:
- Note
- similar to getDBIDriverCapabilityList() except uses the standard function naming scheme (ie
"names_like_this()"
instead of "camelCase()"
) and does not have a NOOP variant
- Since
- Qore 0.8.6
*list Qore::SQL::dbi_get_driver_list |
( |
| ) |
|
Returns a list of strings of DBI drivers currently loaded or NOTHING if no drivers are loaded.
- Returns
- a list of strings of DBI drivers currently loaded or NOTHING if no drivers are loaded
- Code Flags:
- CONSTANT
- Example:
- Note
- similar to getDBIDriverList() except uses the standard function naming scheme (ie
"names_like_this()"
instead of "camelCase()"
)
- Since
- Qore 0.8.6
*hash Qore::SQL::dbi_get_driver_options |
( |
string |
driver | ) |
|
returns a hash of driver options
- Code Flags:
- CONSTANT
- Parameters
-
driver | the name of the driver; if the given driver is not already loaded then this function returns NOTHING |
- Returns
- if the given driver is not already loaded then the function returns NOTHING; if the driver does not support any options then an empty hash is returned, otherwise a hash is returned where the keys are valid option names, and the values are hashes with the following keys:
"desc"
: a string description of the option
"type"
: a string giving the data type restriction for the option
- Example:
- Since
- Qore 0.8.6
hash Qore::SQL::parse_datasource |
( |
string |
ds | ) |
|
Returns a datasource hash of the components of a datasource string.
- Code Flags:
- RET_VALUE_ONLY
- Parameters
-
ds | a string describing the datasource with the following syntax:
[ driver:][ user]:[/ pass]@ db[( charset)][% host[: port][{ option= val[,...]}]
where all elements except @ db are optional |
- Returns
- a datasource hash of the components of a datasource string
- Example:
- Exceptions
-
DATASOURCE-PARSE-ERROR | a syntax error occurred parsing the datasource string (missing field, unexpected character, etc) |
- Note
- similar to parseDatasource() except uses the standard function naming scheme (ie
"names_like_this()"
instead of "camelCase()"
) and does not have a NOOP variant
- Since
- Qore 0.8.6