Qore DbDataProvider Module Reference 2.1.1
Loading...
Searching...
No Matches
DbTableDataProvider.qc.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
3
26namespace DbDataProvider {
28class DbTableDataProvider : public AbstractDataProvider {
29
30public:
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
103protected:
105 AbstractTable table;
106
108 AbstractDatabase db;
109
111 Mutex db_lock();
112
113public:
114
116 constructor(AbstractTable table, *LoggerInterface 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
144
145
147
155
156
158
164
165
167
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, hash<auto> ctx, *reference<bool> missing_input);
195
196
198 int doSequenceCurrvalKey(string sequence_name, hash<auto> ctx, *reference<bool> missing_input);
199
200
202protected:
203 *hash<string, AbstractDataField> getRecordTypeImpl(*hash<auto> search_options);
204public:
205
206
208
216protected:
217 *hash<auto> createRecordImpl(hash<auto> rec, *hash<auto> create_options);
218public:
219
220
222
230 string upsertRecordImpl(hash<auto> rec, *hash<auto> upsert_options);
231
232
234
239protected:
240 *hash<auto> searchSingleRecordImpl(hash<auto> where_cond, *hash<auto> search_options);
241public:
242
243
245
252protected:
253 AbstractDataProviderBulkRecordInterface searchRecordsBulkImpl(int block_size = 1000, *hash<auto> where_cond, *hash<auto> search_options);
254public:
255
256
258
266protected:
267 DbTableRecordIterator searchRecordsImpl(*hash<auto> where_cond, *hash<auto> search_options);
268public:
269
270
272
281protected:
282 bool updateSingleRecordImpl(hash<auto> set, hash<auto> where_cond, *hash<auto> search_options);
283public:
284
285
287
296protected:
297 int updateRecordsImpl(hash<auto> set, *hash<auto> where_cond, *hash<auto> search_options);
298public:
299
300
302
313protected:
314 int deleteRecordsImpl(*hash<auto> where_cond, *hash<auto> search_options);
315public:
316
317
319protected:
320 hash<DataProviderInfo> getStaticInfoImpl();
321public:
322
323
325
333protected:
334 addFieldImpl(AbstractDataField field, *hash<auto> field_add_options);
335public:
336
337
339
345protected:
346 updateFieldImpl(string name, AbstractDataField field, *hash<auto> field_update_options);
347public:
348
349
351
356protected:
357 deleteFieldImpl(string name, *hash<auto> field_delete_options);
358public:
359
360
362protected:
363 alignTable(hash<auto> table_desc);
364public:
365
366
368protected:
369 execDdlSql(list<auto> sqll);
370public:
371
372};
373};
Defines a data provider based on a single SQL table.
Definition DbTableDataProvider.qc.dox.h:28
int doSequenceCurrvalKey(string sequence_name, hash< auto > ctx, *reference< bool > missing_input)
Processes the sequence_currval runtime key in mappers as a mapper key handler.
execDdlSql(list< auto > sqll)
Executes the given DDL SQL string list.
int doSequenceKey(string sequence_name, hash< auto > ctx, *reference< bool > missing_input)
Processes the sequence runtime key in mappers as a mapper key handler.
addFieldImpl(AbstractDataField field, *hash< auto > field_add_options)
Creates a new field.
*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
hash< DataProviderInfo > getStaticInfoImpl()
Returns data provider static info.
string upsertRecordImpl(hash< auto > rec, *hash< auto > upsert_options)
Upserts the given record to the data provider.
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
DbTableRecordIterator searchRecordsImpl(*hash< auto > where_cond, *hash< auto > search_options)
Returns an iterator for zero or more records 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.
constructor(AbstractTable table, *LoggerInterface logger)
Creates the object.
alignTable(hash< auto > table_desc)
Align table with the given description.
const CreateOptions
Create options; see details below.
Definition DbTableDataProvider.qc.dox.h:58
*hash< auto > createRecordImpl(hash< auto > rec, *hash< auto > create_options)
Writes the given record to the data provider.
*hash< string, AbstractDataField > getRecordTypeImpl(*hash< auto > search_options)
Returns the description of the record type, if any.
hash< DataProviderInfo > getInfo()
Returns data provider info.
*hash< auto > searchSingleRecordImpl(hash< auto > where_cond, *hash< auto > search_options)
Returns a single record 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.
*hash< string, hash< MapperRuntimeKeyInfo > > getMapperRuntimeKeys()
Returns custom data mapper runtime keys.
constructor(*hash< auto > options)
Creates the object from constructor options.
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.
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:28
Qore AbstractDbRecordIterator class definition.
Definition AbstractDbRecordIterator.qc.dox.h:26