Qore DbDataProvider Module Reference  1.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  const MapperKeyInfo = ...;
37 
38 
40  const ConstructorOptions = ...;
41 
42 
44  const CreateOptions = ...;
45 
46 
48  const UpsertOptions = ...;
49 
50 
52  const SearchOptions = ...;
53 
54 
56  const DbUpsertMap = ...;
57 
58 
59 protected:
61  AbstractTable table;
62 
64  AbstractDatabase db;
65 
67  Mutex db_lock();
68 
69 public:
70 
72  constructor(AbstractTable table);
73 
74 
76  constructor(*hash<auto> options);
77 
78 
80  string getName();
81 
82 
84  *AbstractDataProvider getChildProviders();
85 
86 
88 
92 
93 
95 
97  commit();
98 
99 
101 
103  rollback();
104 
105 
107 
109  AbstractDataProviderBulkOperation getBulkInserter();
110 
111 
113 
115  AbstractDataProviderBulkOperation getBulkUpserter();
116 
117 
119 
121  *hash<string, hash<MapperRuntimeKeyInfo>> getMapperRuntimeKeys();
122 
123 
125 protected:
126  *hash<string, AbstractDataField> getRecordTypeImpl(*hash<auto> search_options);
127 public:
128 
129 
131 
139 protected:
140  *hash<auto> createRecordImpl(hash<auto> rec, *hash<auto> create_options);
141 public:
142 
143 
145 
153  string upsertRecordImpl(hash<auto> rec, *hash<auto> upsert_options);
154 
155 
157 
161 protected:
162  *hash<auto> searchSingleRecordImpl(hash<auto> where_cond, *hash<auto> search_options);
163 public:
164 
165 
167 
174 protected:
175  AbstractDataProviderBulkRecordInterface searchRecordsBulkImpl(int block_size = 1000, *hash<auto> where_cond, *hash<auto> search_options);
176 public:
177 
178 
180 
187 protected:
188  DbTableRecordIterator searchRecordsImpl(*hash<auto> where_cond, *hash<auto> search_options);
189 public:
190 
191 
193 
202 protected:
203  bool updateSingleRecordImpl(hash<auto> set, hash<auto> where_cond, *hash<auto> search_options);
204 public:
205 
206 
208 
217 protected:
218  int updateRecordsImpl(hash<auto> set, *hash<auto> where_cond, *hash<auto> search_options);
219 public:
220 
221 
223 
234 protected:
235  int deleteRecordsImpl(*hash<auto> where_cond, *hash<auto> search_options);
236 public:
237 
238 
240 protected:
241  hash<DataProviderInfo> getStaticInfoImpl();
242 public:
243 
244 
246  int doSequenceKey(string sequence_name);
247 
248 
250  int doSequenceCurrvalKey(string sequence_name);
251 
252 };
253 };
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.
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.
Definition: DbTableDataProvider.qc.dox.h:36
const SearchOptions
Search options.
Definition: DbTableDataProvider.qc.dox.h:52
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.
Definition: DbTableDataProvider.qc.dox.h:48
AbstractDatabase db
the database object, if required
Definition: DbTableDataProvider.qc.dox.h:64
AbstractTable table
the table
Definition: DbTableDataProvider.qc.dox.h:61
*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:56
*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.
Definition: DbTableDataProvider.qc.dox.h:44
constructor(AbstractTable table)
Creates the object.
bool updateSingleRecordImpl(hash< auto > set, hash< auto > where_cond, *hash< auto > search_options)
Updates a single record matching the search options.
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:40
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.