| 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 hash<DataProviderInfo> getInfo();
133
134
136 *AbstractDataProvider getChildProviders();
137
138
140
143 bool requiresTransactionManagement();
144
145
147
154 beginTransaction();
155
156
158
163 commit();
164
165
167
172 rollback();
173
174
176
178 AbstractDataProviderBulkOperation getBulkInserter();
179
180
182
184 AbstractDataProviderBulkOperation getBulkUpserter();
185
186
188
190 *hash<string, hash<MapperRuntimeKeyInfo>> getMapperRuntimeKeys();
191
192
194 int doSequenceKey(string sequence_name);
195
196
198 int doSequenceCurrvalKey(string sequence_name);
199
200
202 protected:
203 *hash<string, AbstractDataField> getRecordTypeImpl(*hash<auto> search_options);
204 public:
205
206
208
216 protected:
217 *hash<auto> createRecordImpl(hash<auto> rec, *hash<auto> create_options);
218 public:
219
220
222
230 string upsertRecordImpl(hash<auto> rec, *hash<auto> upsert_options);
231
232
234
238 protected:
239 *hash<auto> searchSingleRecordImpl(hash<auto> where_cond, *hash<auto> search_options);
240 public:
241
242
244
251 protected:
252 AbstractDataProviderBulkRecordInterface searchRecordsBulkImpl(int block_size = 1000, *hash<auto> where_cond, *hash<auto> search_options);
253 public:
254
255
257
264 protected:
265 DbTableRecordIterator searchRecordsImpl(*hash<auto> where_cond, *hash<auto> search_options);
266 public:
267
268
270
279 protected:
280 bool updateSingleRecordImpl(hash<auto> set, hash<auto> where_cond, *hash<auto> search_options);
281 public:
282
283
285
294 protected:
295 int updateRecordsImpl(hash<auto> set, *hash<auto> where_cond, *hash<auto> search_options);
296 public:
297
298
300
311 protected:
312 int deleteRecordsImpl(*hash<auto> where_cond, *hash<auto> search_options);
313 public:
314
315
317 protected:
318 hash<DataProviderInfo> getStaticInfoImpl();
319 public:
320
321
323
331 protected:
332 addFieldImpl(AbstractDataField field, *hash<auto> field_add_options);
333 public:
334
335
337
343 protected:
344 updateFieldImpl(string name, AbstractDataField field, *hash<auto> field_update_options);
345 public:
346
347
349
354 protected:
355 deleteFieldImpl(string name, *hash<auto> field_delete_options);
356 public:
357
358
360 protected:
361 alignTable(hash<auto> table_desc);
362 public:
363
364
366 protected:
367 execDdlSql(list<auto> sqll);
368 public:
369
370 };
371 };
DbDataProvider::DbTableDataProvider
Defines a data provider based on a single SQL table.
Definition: DbTableDataProvider.qc.dox.h:28
DbDataProvider::DbTableDataProvider::execDdlSql
execDdlSql(list< auto > sqll)
Executes the given DDL SQL string list.
DbDataProvider::DbTableDataProvider::addFieldImpl
addFieldImpl(AbstractDataField field, *hash< auto > field_add_options)
Creates a new field.
DbDataProvider::DbTableDataProvider::getRecordTypeImpl
*hash< string, AbstractDataField > getRecordTypeImpl(*hash< auto > search_options)
Returns the description of the record type, if any.
DbDataProvider::DbTableDataProvider::getDesc
*string getDesc()
Returns the data provider description.
DbDataProvider::DbTableDataProvider::getName
string getName()
Returns the data provider name.
DbDataProvider::DbTableDataProvider::getChildProviders
*AbstractDataProvider getChildProviders()
Returns child providers; return NOTHING if there are no child providers.
DbDataProvider::DbTableDataProvider::beginTransaction
beginTransaction()
Begins a transaction in the datasource underlying the table.
DbDataProvider::DbTableDataProvider::db_lock
Mutex db_lock()
lock for "db"
DbDataProvider::DbTableDataProvider::MapperKeyInfo
const MapperKeyInfo
Mapper runtime key info; see details below.
Definition: DbTableDataProvider.qc.dox.h:41
DbDataProvider::DbTableDataProvider::DbUpsertMap
const DbUpsertMap
Maps SqlUtil Upsert Result Codes to DB Provider Upsert Result Codes.
Definition: DbTableDataProvider.qc.dox.h:100
DbDataProvider::DbTableDataProvider::commit
commit()
Commits data written to the data provider.
DbDataProvider::DbTableDataProvider::ProviderInfo
const ProviderInfo
Provider info.
Definition: DbTableDataProvider.qc.dox.h:32
DbDataProvider::DbTableDataProvider::upsertRecordImpl
string upsertRecordImpl(hash< auto > rec, *hash< auto > upsert_options)
Upserts the given record to the data provider.
DbDataProvider::DbTableDataProvider::doSequenceCurrvalKey
int doSequenceCurrvalKey(string sequence_name)
Processes the sequence_currval runtime key in mappers.
DbDataProvider::DbTableDataProvider::ConstructorOptions
const ConstructorOptions
Constructor options.
Definition: DbTableDataProvider.qc.dox.h:45
DbDataProvider::DbTableDataProvider::updateSingleRecordImpl
bool updateSingleRecordImpl(hash< auto > set, hash< auto > where_cond, *hash< auto > search_options)
Updates a single record matching the search options.
DbDataProvider::DbTableDataProvider::SearchOptions
const SearchOptions
Search options; see details below.
Definition: DbTableDataProvider.qc.dox.h:96
DbDataProvider::DbTableDataProvider::getStaticInfoImpl
hash< DataProviderInfo > getStaticInfoImpl()
Returns data provider static info.
DbDataProvider::DbTableDataProvider::searchRecordsImpl
DbTableRecordIterator searchRecordsImpl(*hash< auto > where_cond, *hash< auto > search_options)
Returns an iterator for zero or more records matching the search options.
DbDataProvider::DbTableDataProvider::searchRecordsBulkImpl
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.
DbDataProvider::DbTableDataProvider::alignTable
alignTable(hash< auto > table_desc)
Align table with the given description.
DbDataProvider::DbTableDataProvider::CreateOptions
const CreateOptions
Create options; see details below.
Definition: DbTableDataProvider.qc.dox.h:58
DbDataProvider::DbTableDataProvider::doSequenceKey
int doSequenceKey(string sequence_name)
Processes the sequence runtime key in mappers.
DbDataProvider::DbTableDataProvider::searchSingleRecordImpl
*hash< auto > searchSingleRecordImpl(hash< auto > where_cond, *hash< auto > search_options)
Returns a single record matching the search options.
DbDataProvider::DbTableDataProvider::db
AbstractDatabase db
the database object, if required
Definition: DbTableDataProvider.qc.dox.h:108
DbDataProvider::DbTableDataProvider::getInfo
hash< DataProviderInfo > getInfo()
Returns data provider info.
DbDataProvider::DbTableDataProvider::getBulkUpserter
AbstractDataProviderBulkOperation getBulkUpserter()
Returns a bulk upsert operation object for the data provider.
DbDataProvider::DbTableDataProvider::deleteRecordsImpl
int deleteRecordsImpl(*hash< auto > where_cond, *hash< auto > search_options)
Deletes zero or more records.
DbDataProvider::DbTableDataProvider::table
AbstractTable table
the table
Definition: DbTableDataProvider.qc.dox.h:105
DbDataProvider::DbTableDataProvider::updateFieldImpl
updateFieldImpl(string name, AbstractDataField field, *hash< auto > field_update_options)
Updates an existing field.
DbDataProvider::DbTableDataProvider::constructor
constructor(*hash< auto > options)
Creates the object from constructor options.
DbDataProvider::DbTableDataProvider::createRecordImpl
*hash< auto > createRecordImpl(hash< auto > rec, *hash< auto > create_options)
Writes the given record to the data provider.
DbDataProvider::DbTableDataProvider::constructor
constructor(AbstractTable table, *Logger logger)
Creates the object.
DbDataProvider::DbTableDataProvider::UpsertOptions
const UpsertOptions
Upsert options; see details below.
Definition: DbTableDataProvider.qc.dox.h:69
DbDataProvider::DbTableDataProvider::rollback
rollback()
Rolls back data written to the data provider.
DbDataProvider::DbTableDataProvider::deleteFieldImpl
deleteFieldImpl(string name, *hash< auto > field_delete_options)
Deletes an existing field.
DbDataProvider::DbTableDataProvider::requiresTransactionManagement
bool requiresTransactionManagement()
Returns True if the data provider supports transaction management.
DbDataProvider::DbTableDataProvider::getMapperRuntimeKeys
*hash< string, hash< MapperRuntimeKeyInfo > > getMapperRuntimeKeys()
Returns custom data mapper runtime keys.
DbDataProvider::DbTableDataProvider::updateRecordsImpl
int updateRecordsImpl(hash< auto > set, *hash< auto > where_cond, *hash< auto > search_options)
Updates zero or more records matching the search options.
DbDataProvider::DbTableDataProvider::getBulkInserter
AbstractDataProviderBulkOperation getBulkInserter()
Returns a bulk insert operation object for the data provider.
DbDataProvider::DbTableRecordIterator
Defines the record iterator class for Table-based iterators.
Definition: DbTableRecordIterator.qc.dox.h:28
DbDataProvider
Qore AbstractDbRecordIterator class definition.
Definition: AbstractDbRecordIterator.qc.dox.h:26