The database data provider class, provides tables as children.
More...
#include <DbDataProvider.qc.dox.h>
Inherits AbstractDataProvider.
|
| beginTransaction () |
| Begins a transaction in the datasource. More...
|
|
| commit () |
| Commits any transaction in progress in the datasource. More...
|
|
| constructor (*hash< auto > options) |
| Creates the object from constructor options.
|
|
| constructor (AbstractDatabase db) |
| creates the object
|
|
| constructor (AbstractDatasource ds, *hash< auto > opts) |
| creates the object
|
|
private AbstractDataProvider | createChildProviderImpl (string name, hash< string, AbstractDataField > fields, *hash< auto > child_create_options) |
| Creates a new child data provider and returns it after adding as a child. More...
|
|
int | doSequenceCurrvalKey (string sequence_name, hash< auto > ctx, *reference< bool > missing_input) |
| Processes the sequence_currval runtime key in mappers as a mapper key handler.
|
|
int | doSequenceKey (string sequence_name, hash< auto > ctx, *reference< bool > missing_input) |
| Processes the sequence runtime key in mappers as a mapper key handler.
|
|
*list< hash< DataProviderSummaryInfo > > | getChildProviderSummaryInfo () |
| Return data provider summary info.
|
|
*string | getDesc () |
| Returns the data provider description.
|
|
*hash< string, hash< MapperRuntimeKeyInfo > > | getMapperRuntimeKeys () |
| Returns custom data mapper runtime keys. More...
|
|
string | getName () |
| Returns the data provider name.
|
|
hash< auto > | makeTableDesc (string name, hash< string, AbstractDataField > fields, *hash< auto > opts) |
| Returns a table description hash from a field description. More...
|
|
| rollback () |
| Rolls back any transaction in progress in the datasource. More...
|
|
private AbstractDataProviderBulkRecordInterface | searchRecordsBulkImpl (int block_size=1000, *hash< auto > where_cond, *hash< auto > search_options) |
| Returns an iterator for zero or more records matching the search options. More...
|
|
|
static hash< GenericColumnInfo > | getColumnDesc (AbstractDatabase db, AbstractDataField field, *hash< auto > opts) |
| Returns a column description hash for a field.
|
|
static AbstractDatasource | getDatasource (AbstractDatasource ds) |
| Returns the given AbstractDatasource object.
|
|
static AbstractDatasource | getDatasource (string ds_string) |
| Returns an AbstractDatasource object from the given string.
|
|
static *hash< string, AbstractDataField > | getRecordTypeFromDescribeHash (hash< auto > describe_hash) |
| Returns the record type description from a describe hash. More...
|
|
static AbstractTable | getTable (AbstractDatasource ds, string table_string) |
| Returns an AbstractTable object from the given datasource and table arguments.
|
|
static AbstractTable | getTable (string ds_string, string table_string) |
| Returns an AbstractTable object from the given datasource and table strings.
|
|
static | setDatasourceLookup (code datasource_lookup) |
| Sets the datasource lookup.
|
|
static | setTableLookup (code table_lookup) |
| Sets the table lookup.
|
|
|
const | ChildCreateOptions |
| Child provider creation options.
|
|
const | ConstructorOptions |
| Constructor options.
|
|
const | MapperKeyInfo |
| Mapper runtime key info; see details below. More...
|
|
const | ProviderInfo |
| Provider info.
|
|
const | SearchOptions |
| Search options.
|
|
|
| deleteChildProviderImpl (string name, *hash< auto > child_delete_options) |
| Deletes a child data provider. More...
|
|
*AbstractDataProvider | getChildProviderImpl (string name) |
| Returns the given child provider or NOTHING if the given child is unknown. More...
|
|
*list< string > | getChildProviderNamesImpl () |
| Returns a list of child data provider names, if any. More...
|
|
*hash< string, AbstractDataField > | getRecordTypeImpl (*hash< auto > search_options) |
| Returns the description of the record type, if any. More...
|
|
hash< DataProviderInfo > | getStaticInfoImpl () |
| Returns data provider static info.
|
|
AbstractDataProviderRecordIterator | searchRecordsImpl (*hash< auto > where_cond, *hash< auto > search_options) |
| Returns an iterator for zero or more records matching the search options. More...
|
|
|
AbstractDatabase | db |
| The database object.
|
|
|
static *code | datasource_lookup |
| Lookup to get an abstract datasource from a name.
|
|
static *code | table_lookup |
| Lookup to get an abstract table from a datasource and a name.
|
|
The database data provider class, provides tables as children.
Generic post-SQL search is provided just for completeness sake, but record filtering should be done in the sql
search option and not in the generic post-SQL generic data provider search for performance reasons.
◆ beginTransaction()
DbDataProvider::DbDataProvider::beginTransaction |
( |
| ) |
|
Begins a transaction in the datasource.
- See also
- :
- Since
- DbDataProvider 1.0.1
◆ commit()
DbDataProvider::DbDataProvider::commit |
( |
| ) |
|
Commits any transaction in progress in the datasource.
- See also
- :
◆ createChildProviderImpl()
private AbstractDataProvider DbDataProvider::DbDataProvider::createChildProviderImpl |
( |
string |
name, |
|
|
hash< string, AbstractDataField > |
fields, |
|
|
*hash< auto > |
child_create_options |
|
) |
| |
|
inline |
Creates a new child data provider and returns it after adding as a child.
- Parameters
-
name | the name of the new child data provider |
fields | the fields for the new child data provider |
child_create_options | the options for creating the new child data provider |
- Returns
- the new child data provider
- Since
- DataProvider 2.0
◆ deleteChildProviderImpl()
DbDataProvider::DbDataProvider::deleteChildProviderImpl |
( |
string |
name, |
|
|
*hash< auto > |
child_delete_options |
|
) |
| |
|
private |
Deletes a child data provider.
- Parameters
-
name | the name of the new child data provider |
child_delete_options | the options for deleting a child data provider |
- Exceptions
-
DELETE-CHILD-PROVIDER-ERROR | error dropping the child data provider |
- Since
- DataProvider 2.0
◆ getChildProviderImpl()
*AbstractDataProvider DbDataProvider::DbDataProvider::getChildProviderImpl |
( |
string |
name | ) |
|
|
private |
Returns the given child provider or NOTHING if the given child is unknown.
- Returns
- the given child provider or NOTHING if the given child is unknown
- Exceptions
-
CHILD-PROVIDER-ERROR | error acquiring child provider |
- See also
- getChildProviderEx()
◆ getChildProviderNamesImpl()
*list< string > DbDataProvider::DbDataProvider::getChildProviderNamesImpl |
( |
| ) |
|
|
private |
Returns a list of child data provider names, if any.
- Returns
- a list of child data provider names, if any
◆ getMapperRuntimeKeys()
*hash< string, hash< MapperRuntimeKeyInfo > > DbDataProvider::DbDataProvider::getMapperRuntimeKeys |
( |
| ) |
|
Returns custom data mapper runtime keys.
- Returns
- custom data mapper runtime keys
◆ getRecordTypeFromDescribeHash()
static *hash< string, AbstractDataField > DbDataProvider::DbDataProvider::getRecordTypeFromDescribeHash |
( |
hash< auto > |
describe_hash | ) |
|
|
static |
Returns the record type description from a describe hash.
- Parameters
-
- Returns
- the record type of the query results
◆ getRecordTypeImpl()
*hash< string, AbstractDataField > DbDataProvider::DbDataProvider::getRecordTypeImpl |
( |
*hash< auto > |
search_options | ) |
|
|
private |
Returns the description of the record type, if any.
- Parameters
-
search_options | to be included and processed by validateSearchOptions() if recordRequiresSearchOptions() is True for this provider, otherwise any value provided in this argument is ignored |
◆ makeTableDesc()
hash< auto > DbDataProvider::DbDataProvider::makeTableDesc |
( |
string |
name, |
|
|
hash< string, AbstractDataField > |
fields, |
|
|
*hash< auto > |
opts |
|
) |
| |
Returns a table description hash from a field description.
- Exceptions
-
TABLE-DESC-ERROR | error in table description |
◆ rollback()
DbDataProvider::DbDataProvider::rollback |
( |
| ) |
|
Rolls back any transaction in progress in the datasource.
- See also
- :
◆ searchRecordsBulkImpl()
private AbstractDataProviderBulkRecordInterface DbDataProvider::DbDataProvider::searchRecordsBulkImpl |
( |
int |
block_size = 1000 , |
|
|
*hash< auto > |
where_cond, |
|
|
*hash< auto > |
search_options |
|
) |
| |
|
inline |
Returns an iterator for zero or more records matching the search options.
- Parameters
-
block_size | the number of records in a read block; must be a positive number |
where_cond | the search criteria after processing by processFieldValues() |
search_options | the search options after processing by validateSearchOptions() |
- Exceptions
-
INVALID-BLOCK-SIZE | the block size must be a positive number |
INVALID-OPERATION | the data provider does not support reading |
◆ searchRecordsImpl()
AbstractDataProviderRecordIterator DbDataProvider::DbDataProvider::searchRecordsImpl |
( |
*hash< auto > |
where_cond, |
|
|
*hash< auto > |
search_options |
|
) |
| |
|
private |
Returns an iterator for zero or more records matching the search options.
- Parameters
-
where_cond | the search criteria |
search_options | the search options after processing by validateSearchOptions() |
- See also
- requestSearchRecordsImpl()
◆ MapperKeyInfo
const DbDataProvider::DbDataProvider::MapperKeyInfo |
Initial value:= Mapper::MapperKeyInfo + {
"sequence": <MapperRuntimeKeyInfo>{
"desc": "names the DB sequence that will be used to populate the field",
"value_type": "string",
"unique_roles": "*",
"returns_type": "int",
},
"sequence_currval": <MapperRuntimeKeyInfo>{
"desc": "names the DB sequence that will be used to populate the field; the current value of the "
"sequence is used; will not increment the sequence",
"value_type": "string",
"unique_roles": "*",
"returns_type": "int",
},
}
Mapper runtime key info; see details below.
The DbDataProvider class supports the following create option:
sequence:
names the DB sequence that will be used to populate the field
sequence_currval:
names the DB sequence that will be used to populate the field; the current value of the sequence is used; will not increment the sequence