Qore DbDataProvider Module Reference  2.0
DbTableDataProvider.qc.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
25 namespace DbDataProvider {
28 class DbTableDataProvider : public AbstractDataProvider {
29 
30 public:
32  const ProviderInfo = ...;
33 
34 
36 
41  const MapperKeyInfo = ...;
42 
43 
45  const ConstructorOptions = ...;
46 
47 
49 
58  const CreateOptions = ...;
59 
60 
62 
69  const UpsertOptions = ...;
70 
71 
73 
96  const SearchOptions = ...;
97 
98 
100  const DbUpsertMap = ...;
101 
102 
103 protected:
105  AbstractTable table;
106 
108  AbstractDatabase db;
109 
111  Mutex db_lock();
112 
113 public:
114 
116  constructor(AbstractTable table, *Logger logger);
117 
118 
120  constructor(*hash<auto> options);
121 
122 
124  string getName();
125 
126 
128  *AbstractDataProvider getChildProviders();
129 
130 
132 
136 
137 
139 
147 
148 
150 
155  commit();
156 
157 
159 
164  rollback();
165 
166 
168 
170  AbstractDataProviderBulkOperation getBulkInserter();
171 
172 
174 
176  AbstractDataProviderBulkOperation getBulkUpserter();
177 
178 
180 
182  *hash<string, hash<MapperRuntimeKeyInfo>> getMapperRuntimeKeys();
183 
184 
186  int doSequenceKey(string sequence_name);
187 
188 
190  int doSequenceCurrvalKey(string sequence_name);
191 
192 
194 protected:
195  *hash<string, AbstractDataField> getRecordTypeImpl(*hash<auto> search_options);
196 public:
197 
198 
200 
208 protected:
209  *hash<auto> createRecordImpl(hash<auto> rec, *hash<auto> create_options);
210 public:
211 
212 
214 
222  string upsertRecordImpl(hash<auto> rec, *hash<auto> upsert_options);
223 
224 
226 
230 protected:
231  *hash<auto> searchSingleRecordImpl(hash<auto> where_cond, *hash<auto> search_options);
232 public:
233 
234 
236 
243 protected:
244  AbstractDataProviderBulkRecordInterface searchRecordsBulkImpl(int block_size = 1000, *hash<auto> where_cond, *hash<auto> search_options);
245 public:
246 
247 
249 
256 protected:
257  DbTableRecordIterator searchRecordsImpl(*hash<auto> where_cond, *hash<auto> search_options);
258 public:
259 
260 
262 
271 protected:
272  bool updateSingleRecordImpl(hash<auto> set, hash<auto> where_cond, *hash<auto> search_options);
273 public:
274 
275 
277 
286 protected:
287  int updateRecordsImpl(hash<auto> set, *hash<auto> where_cond, *hash<auto> search_options);
288 public:
289 
290 
292 
303 protected:
304  int deleteRecordsImpl(*hash<auto> where_cond, *hash<auto> search_options);
305 public:
306 
307 
309 protected:
310  hash<DataProviderInfo> getStaticInfoImpl();
311 public:
312 
313 
315 
323 protected:
324  addFieldImpl(AbstractDataField field, *hash<auto> field_add_options);
325 public:
326 
327 
329 
335 protected:
336  updateFieldImpl(string name, AbstractDataField field, *hash<auto> field_update_options);
337 public:
338 
339 
341 
346 protected:
347  deleteFieldImpl(string name, *hash<auto> field_delete_options);
348 public:
349 
350 
352 protected:
353  alignTable(hash<auto> table_desc);
354 public:
355 
356 
358 protected:
359  execDdlSql(list<auto> sqll);
360 public:
361 
362 };
363 };
AbstractDataProviderBulkOperation getBulkInserter()
Returns a bulk insert operation object for the data provider.
Defines the record iterator class for Table-based iterators.
Definition: DbTableRecordIterator.qc.dox.h:34
int doSequenceKey(string sequence_name)
Processes the sequence runtime key in mappers.
constructor(AbstractTable table, *Logger logger)
Creates the object.
int doSequenceCurrvalKey(string sequence_name)
Processes the sequence_currval runtime key in mappers.
const ProviderInfo
Provider info.
Definition: DbTableDataProvider.qc.dox.h:32
int updateRecordsImpl(hash< auto > set, *hash< auto > where_cond, *hash< auto > search_options)
Updates zero or more records matching the search options.
*hash< string, hash< MapperRuntimeKeyInfo > > getMapperRuntimeKeys()
Returns custom data mapper runtime keys.
Defines a data provider based on a single SQL table.
Definition: DbTableDataProvider.qc.dox.h:28
commit()
Commits data written to the data provider.
int deleteRecordsImpl(*hash< auto > where_cond, *hash< auto > search_options)
Deletes zero or more records.
const MapperKeyInfo
Mapper runtime key info; see details below.
Definition: DbTableDataProvider.qc.dox.h:41
updateFieldImpl(string name, AbstractDataField field, *hash< auto > field_update_options)
Updates an existing field.
const SearchOptions
Search options; see details below.
Definition: DbTableDataProvider.qc.dox.h:96
hash< DataProviderInfo > getStaticInfoImpl()
Returns data provider static info.
bool requiresTransactionManagement()
Returns True if the data provider supports transaction management.
string upsertRecordImpl(hash< auto > rec, *hash< auto > upsert_options)
Upserts the given record to the data provider.
*AbstractDataProvider getChildProviders()
Returns child providers; return NOTHING if there are no child providers.
const UpsertOptions
Upsert options; see details below.
Definition: DbTableDataProvider.qc.dox.h:69
AbstractDatabase db
the database object, if required
Definition: DbTableDataProvider.qc.dox.h:108
addFieldImpl(AbstractDataField field, *hash< auto > field_add_options)
Creates a new field.
alignTable(hash< auto > table_desc)
Align table with the given description.
AbstractTable table
the table
Definition: DbTableDataProvider.qc.dox.h:105
*hash< string, AbstractDataField > getRecordTypeImpl(*hash< auto > search_options)
Returns the description of the record type, if any.
const DbUpsertMap
Maps SqlUtil Upsert Result Codes to DB Provider Upsert Result Codes.
Definition: DbTableDataProvider.qc.dox.h:100
*hash< auto > searchSingleRecordImpl(hash< auto > where_cond, *hash< auto > search_options)
Returns a single record matching the search options.
rollback()
Rolls back data written to the data provider.
*hash< auto > createRecordImpl(hash< auto > rec, *hash< auto > create_options)
Writes the given record to the data provider.
DbTableRecordIterator searchRecordsImpl(*hash< auto > where_cond, *hash< auto > search_options)
Returns an iterator for zero or more records matching the search options.
string getName()
Returns the data provider name.
const CreateOptions
Create options; see details below.
Definition: DbTableDataProvider.qc.dox.h:58
execDdlSql(list< auto > sqll)
Executes the given DDL SQL string list.
beginTransaction()
Begins a transaction in the datasource underlying the table.
bool updateSingleRecordImpl(hash< auto > set, hash< auto > where_cond, *hash< auto > search_options)
Updates a single record matching the search options.
deleteFieldImpl(string name, *hash< auto > field_delete_options)
Deletes an existing field.
Qore AbstractDbRecordIterator class definition.
Definition: AbstractDbRecordIterator.qc.dox.h:32
AbstractDataProviderBulkOperation getBulkUpserter()
Returns a bulk upsert operation object for the data provider.
const ConstructorOptions
Constructor options.
Definition: DbTableDataProvider.qc.dox.h:45
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.