Qore DbDataProvider Module Reference  2.0
DbDataProvider.qc.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
26 namespace DbDataProvider {
28 class DbDataProvider : public AbstractDataProvider {
29 
30 public:
32  const ProviderInfo = ...;
33 
34 
36  const ConstructorOptions = ...;
37 
38 
40  const SearchOptions = ...;
41 
42 
44  const ChildCreateOptions = ...;
45 
46 
47 protected:
49  AbstractDatabase db;
50 
52  static *code datasource_lookup;
53 
55  static *code table_lookup;
56 
57 public:
58 
60  constructor(AbstractDatasource ds, *hash<auto> opts);
61 
62 
64  constructor(AbstractDatabase db);
65 
66 
68  constructor(*hash<auto> options);
69 
70 
72  string getName();
73 
74 
76 
84 
85 
87 
92  commit();
93 
94 
96 
102 
103 
105 
110  static *hash<string, AbstractDataField> getRecordTypeFromDescribeHash(hash<auto> describe_hash);
111 
113 
117 protected:
118  *hash<string, AbstractDataField> getRecordTypeImpl(*hash<auto> search_options);
119 public:
120 
121 
123 
130 protected:
131  AbstractDataProviderBulkRecordInterface searchRecordsBulkImpl(int block_size = 1000, *hash<auto> where_cond, *hash<auto> search_options);
132 public:
133 
134 
136 
141 protected:
142  AbstractDataProviderRecordIterator searchRecordsImpl(*hash<auto> where_cond, *hash<auto> search_options);
143 public:
144 
145 
147 
149 protected:
150  *list<string> getChildProviderNamesImpl();
151 public:
152 
153 
155 
161 protected:
162  *AbstractDataProvider getChildProviderImpl(string name);
163 public:
164 
165 
167 protected:
168  hash<DataProviderInfo> getStaticInfoImpl();
169 public:
170 
171 
173 
181 protected:
182  AbstractDataProvider createChildProviderImpl(string name, hash<string, AbstractDataField> fields, *hash<auto> child_create_options);
183 public:
184 
185 
187 
194 protected:
195  deleteChildProviderImpl(string name, *hash<auto> child_delete_options);
196 public:
197 
198 
200  static setDatasourceLookup(code datasource_lookup);
201 
203  static setTableLookup(code table_lookup);
204 
206  static AbstractDatasource getDatasource(AbstractDatasource ds);
207 
209  static AbstractDatasource getDatasource(string ds_string);
210 
212  static AbstractTable getTable(string ds_string, string table_string);
213 
215  static AbstractTable getTable(AbstractDatasource ds, string table_string);
216 
218  static hash<GenericColumnInfo> getColumnDesc(AbstractDatabase db, AbstractDataField field, *hash<auto> opts);
219 
221 
223  hash<auto> makeTableDesc(string name, hash<string, AbstractDataField> fields, *hash<auto> opts);
224 
225 };
226 };
*list< string > getChildProviderNamesImpl()
Returns a list of child data provider names, if any.
static *code datasource_lookup
Lookup to get an abstract datasource from a name.
Definition: DbDataProvider.qc.dox.h:52
static AbstractTable getTable(string ds_string, string table_string)
Returns an AbstractTable object from the given datasource and table strings.
beginTransaction()
Begins a transaction in the datasource.
commit()
Commits any transaction in progress in the datasource.
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.
hash< auto > makeTableDesc(string name, hash< string, AbstractDataField > fields, *hash< auto > opts)
Returns a table description hash from a field description.
AbstractDatabase db
The database object.
Definition: DbDataProvider.qc.dox.h:49
static AbstractTable getTable(AbstractDatasource ds, string table_string)
Returns an AbstractTable object from the given datasource and table arguments.
static setDatasourceLookup(code datasource_lookup)
Sets the datasource lookup.
static AbstractDatasource getDatasource(AbstractDatasource ds)
Returns the given AbstractDatasource object.
hash< DataProviderInfo > getStaticInfoImpl()
Returns data provider static info.
deleteChildProviderImpl(string name, *hash< auto > child_delete_options)
Deletes a child data provider.
*AbstractDataProvider getChildProviderImpl(string name)
Returns the given child provider or NOTHING if the given child is unknown.
constructor(AbstractDatasource ds, *hash< auto > opts)
creates the object
static hash< GenericColumnInfo > getColumnDesc(AbstractDatabase db, AbstractDataField field, *hash< auto > opts)
Returns a column description hash for a field.
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.
string getName()
Returns the data provider name.
static *code table_lookup
Lookup to get an abstract table from a datasource and a name.
Definition: DbDataProvider.qc.dox.h:55
constructor(AbstractDatabase db)
creates the object
static setTableLookup(code table_lookup)
Sets the table lookup.
*hash< string, AbstractDataField > getRecordTypeImpl(*hash< auto > search_options)
Returns the description of the record type, if any.
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.
constructor(*hash< auto > options)
Creates the object from constructor options.
rollback()
Rolls back any transaction in progress in the datasource.
Qore AbstractDbRecordIterator class definition.
Definition: AbstractDbRecordIterator.qc.dox.h:32