Qore DbDataProvider Module Reference  2.0
DbTableDataProvider.qc.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
26 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  *string getDesc();
129 
130 
132  *AbstractDataProvider getChildProviders();
133 
134 
136 
140 
141 
143 
151 
152 
154 
160 
161 
163 
169 
170 
172 
174  AbstractDataProviderBulkOperation getBulkInserter();
175 
176 
178 
180  AbstractDataProviderBulkOperation getBulkUpserter();
181 
182 
184 
186  *hash<string, hash<MapperRuntimeKeyInfo>> getMapperRuntimeKeys();
187 
188 
190  int doSequenceKey(string sequence_name);
191 
192 
194  int doSequenceCurrvalKey(string sequence_name);
195 
196 
198 protected:
199  *hash<string, AbstractDataField> getRecordTypeImpl(*hash<auto> search_options);
200 public:
201 
202 
204 
212 protected:
213  *hash<auto> createRecordImpl(hash<auto> rec, *hash<auto> create_options);
214 public:
215 
216 
218 
226  string upsertRecordImpl(hash<auto> rec, *hash<auto> upsert_options);
227 
228 
230 
234 protected:
235  *hash<auto> searchSingleRecordImpl(hash<auto> where_cond, *hash<auto> search_options);
236 public:
237 
238 
240 
247 protected:
248  AbstractDataProviderBulkRecordInterface searchRecordsBulkImpl(int block_size = 1000, *hash<auto> where_cond, *hash<auto> search_options);
249 public:
250 
251 
253 
260 protected:
261  DbTableRecordIterator searchRecordsImpl(*hash<auto> where_cond, *hash<auto> search_options);
262 public:
263 
264 
266 
275 protected:
276  bool updateSingleRecordImpl(hash<auto> set, hash<auto> where_cond, *hash<auto> search_options);
277 public:
278 
279 
281 
290 protected:
291  int updateRecordsImpl(hash<auto> set, *hash<auto> where_cond, *hash<auto> search_options);
292 public:
293 
294 
296 
307 protected:
308  int deleteRecordsImpl(*hash<auto> where_cond, *hash<auto> search_options);
309 public:
310 
311 
313 protected:
314  hash<DataProviderInfo> getStaticInfoImpl();
315 public:
316 
317 
319 
327 protected:
328  addFieldImpl(AbstractDataField field, *hash<auto> field_add_options);
329 public:
330 
331 
333 
339 protected:
340  updateFieldImpl(string name, AbstractDataField field, *hash<auto> field_update_options);
341 public:
342 
343 
345 
350 protected:
351  deleteFieldImpl(string name, *hash<auto> field_delete_options);
352 public:
353 
354 
356 protected:
357  alignTable(hash<auto> table_desc);
358 public:
359 
360 
362 protected:
363  execDdlSql(list<auto> sqll);
364 public:
365 
366 };
367 };
Defines a data provider based on a single SQL table.
Definition: DbTableDataProvider.qc.dox.h:28
execDdlSql(list< auto > sqll)
Executes the given DDL SQL string list.
addFieldImpl(AbstractDataField field, *hash< auto > field_add_options)
Creates a new field.
*hash< string, AbstractDataField > getRecordTypeImpl(*hash< auto > search_options)
Returns the description of the record type, if any.
*string getDesc()
Returns the data provider description.
string getName()
Returns the data provider name.
*AbstractDataProvider getChildProviders()
Returns child providers; return NOTHING if there are no child providers.
beginTransaction()
Begins a transaction in the datasource underlying the table.
const MapperKeyInfo
Mapper runtime key info; see details below.
Definition: DbTableDataProvider.qc.dox.h:41
const DbUpsertMap
Maps SqlUtil Upsert Result Codes to DB Provider Upsert Result Codes.
Definition: DbTableDataProvider.qc.dox.h:100
commit()
Commits data written to the data provider.
const ProviderInfo
Provider info.
Definition: DbTableDataProvider.qc.dox.h:32
string upsertRecordImpl(hash< auto > rec, *hash< auto > upsert_options)
Upserts the given record to the data provider.
int doSequenceCurrvalKey(string sequence_name)
Processes the sequence_currval runtime key in mappers.
const ConstructorOptions
Constructor options.
Definition: DbTableDataProvider.qc.dox.h:45
bool updateSingleRecordImpl(hash< auto > set, hash< auto > where_cond, *hash< auto > search_options)
Updates a single record matching the search options.
const SearchOptions
Search options; see details below.
Definition: DbTableDataProvider.qc.dox.h:96
hash< DataProviderInfo > getStaticInfoImpl()
Returns data provider static info.
DbTableRecordIterator searchRecordsImpl(*hash< auto > where_cond, *hash< auto > search_options)
Returns an iterator for zero or more records matching the search options.
alignTable(hash< auto > table_desc)
Align table with the given description.
const CreateOptions
Create options; see details below.
Definition: DbTableDataProvider.qc.dox.h:58
int doSequenceKey(string sequence_name)
Processes the sequence runtime key in mappers.
*hash< auto > searchSingleRecordImpl(hash< auto > where_cond, *hash< auto > search_options)
Returns a single record matching the search options.
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.
AbstractDatabase db
the database object, if required
Definition: DbTableDataProvider.qc.dox.h:108
AbstractDataProviderBulkOperation getBulkUpserter()
Returns a bulk upsert operation object for the data provider.
int deleteRecordsImpl(*hash< auto > where_cond, *hash< auto > search_options)
Deletes zero or more records.
AbstractTable table
the table
Definition: DbTableDataProvider.qc.dox.h:105
updateFieldImpl(string name, AbstractDataField field, *hash< auto > field_update_options)
Updates an existing field.
constructor(*hash< auto > options)
Creates the object from constructor options.
*hash< auto > createRecordImpl(hash< auto > rec, *hash< auto > create_options)
Writes the given record to the data provider.
constructor(AbstractTable table, *Logger logger)
Creates the object.
const UpsertOptions
Upsert options; see details below.
Definition: DbTableDataProvider.qc.dox.h:69
rollback()
Rolls back data written to the data provider.
deleteFieldImpl(string name, *hash< auto > field_delete_options)
Deletes an existing field.
bool requiresTransactionManagement()
Returns True if the data provider supports transaction management.
*hash< string, hash< MapperRuntimeKeyInfo > > getMapperRuntimeKeys()
Returns custom data mapper runtime keys.
int updateRecordsImpl(hash< auto > set, *hash< auto > where_cond, *hash< auto > search_options)
Updates zero or more records matching the search options.
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
Qore AbstractDbRecordIterator class definition.
Definition: AbstractDbRecordIterator.qc.dox.h:32