 |
Qore DbDataProvider Module Reference
1.0
|
38 const ProviderInfo = <DataProviderInfo>{
39 "type":
"DbDataProvider",
40 "supports_read":
True,
41 "supports_bulk_read":
True,
42 "supports_children":
True,
43 "constructor_options": ConstructorOptions,
44 "search_options": SearchOptions,
47 "transaction_management":
True,
49 "record_requires_search_options":
True,
53 const ConstructorOptions = {
54 "datasource": <DataProviderOptionInfo>{
56 AbstractDataProviderType::get(StringType),
57 AbstractDataProviderType::get(
new Type(
"AbstractDatasource")),
59 "desc":
"the datasource connection string or an abstract datasource object",
61 "database": <DataProviderOptionInfo>{
62 "type": AbstractDataProviderType::get(
new Type(
"AbstractDatabase")),
63 "desc":
"the database for the object",
68 const SearchOptions = {
69 "sql": <DataProviderOptionInfo>{
70 "type": AbstractDataProviderType::get(StringType),
71 "desc":
"the raw SQL for the select statement",
74 "args": <DataProviderOptionInfo>{
75 "type": AbstractDataProviderType::get(AutoListType),
76 "desc":
"any bind arguments for the select statement",
147 AbstractDataProviderBulkRecordInterface
searchRecordsBulkImpl(
int block_size = 1000, *hash<auto> where_cond, *hash<auto> search_options);
158 AbstractDataProviderRecordIterator
searchRecordsImpl(*hash<auto> where_cond, *hash<auto> search_options);
201 static AbstractTable
getTable(
string ds_string,
string table_string);
204 static AbstractTable
getTable(AbstractDatasource ds,
string table_string);
rollback()
Rolls back any transaction in progress in the datasource.
string getName()
Returns the data provider name.
commit()
Commits any transaction in progress in the datasource.
static setTableLookup(code table_lookup)
Sets the table lookup.
constructor(AbstractDatasource ds, *hash< auto > opts)
creates the object
static *code datasource_lookup
Lookup to get an abstract datasource from a name.
Definition: DbDataProvider.qc.dox.h:85
*hash< string, AbstractDataField > getRecordTypeImpl(*hash< auto > search_options)
Returns the description of the record type, if any.
static AbstractDatasource getDatasource(string ds_string)
Returns an AbstractDatasource object from the given string.
static AbstractTable getTable(AbstractDatasource ds, string table_string)
Returns an AbstractTable object from the given datasource and table arguments.
hash< DataProviderInfo > getStaticInfoImpl()
Returns data provider static info.
static *code table_lookup
Lookup to get an abstract table from a datasource and a name.
Definition: DbDataProvider.qc.dox.h:88
static setDatasourceLookup(code datasource_lookup)
Sets the datasource lookup.
static AbstractDatasource getDatasource(AbstractDatasource ds)
Returns the given AbstractDatasource object.
static *hash< string, AbstractDataField > getRecordTypeFromDescribeHash(hash< auto > describe_hash)
Returns the record type description from a describe hash.
AbstractDatabase db
The database object.
Definition: DbDataProvider.qc.dox.h:82
static AbstractTable getTable(string ds_string, string table_string)
Returns an AbstractTable object from the given datasource and table strings.
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.
AbstractDataProviderRecordIterator searchRecordsImpl(*hash< auto > where_cond, *hash< auto > search_options)
Returns an iterator for zero or more records matching the search options.
*AbstractDataProvider getChildProviderImpl(string name)
Returns the given child provider or NOTHING if the given child is unknown.
*list< string > getChildProviderNamesImpl()
Returns a list of child data provider names, if any.
Qore AbstractDbRecordIterator class definition.
Definition: AbstractDbRecordIterator.qc.dox.h:32
constructor(AbstractDatabase db)
creates the object
constructor(*hash< auto > options)
Creates the object from constructor options.