Qore DbDataProvider Module Reference  1.0
DbTableDataProvider.qc.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
25 // minimum required Qore version
26 // assume local scope for variables, do not use "$" signs
27 // require type definitions everywhere
29 // enable all warnings
30 
32 namespace DbDataProvider {
34 class DbTableDataProvider : public AbstractDataProvider {
35 
36 public:
38  const ProviderInfo = ...;
39 
40 
42  const MapperKeyInfo = ...;
43 
44 
46  const ConstructorOptions = ...;
47 
48 
50  const CreateOptions = ...;
51 
52 
54  const UpsertOptions = ...;
55 
56 
58  const SearchOptions = ...;
59 
60 
62  const DbUpsertMap = ...;
63 
64 
65 protected:
67  AbstractTable table;
68 
70  AbstractDatabase db;
71 
73  Mutex db_lock();
74 
75 public:
76 
78  constructor(AbstractTable table);
79 
80 
82  constructor(*hash<auto> options);
83 
84 
86  string getName();
87 
88 
90  *AbstractDataProvider getChildProviders();
91 
92 
94 
98 
99 
101 
104 
105 
107 
110 
111 
113 
115  AbstractDataProviderBulkOperation getBulkInserter();
116 
117 
119 
121  AbstractDataProviderBulkOperation getBulkUpserter();
122 
123 
125 
127  *hash<string, hash<MapperRuntimeKeyInfo>> getMapperRuntimeKeys();
128 
129 
131 protected:
132  *hash<string, AbstractDataField> getRecordTypeImpl(*hash<auto> search_options);
133 public:
134 
135 
137 
145 protected:
146  *hash<auto> createRecordImpl(hash<auto> rec, *hash<auto> create_options);
147 public:
148 
149 
151 
159  string upsertRecordImpl(hash<auto> rec, *hash<auto> upsert_options);
160 
161 
163 
167 protected:
168  *hash<auto> searchSingleRecordImpl(hash<auto> where_cond, *hash<auto> search_options);
169 public:
170 
171 
173 
180 protected:
181  AbstractDataProviderBulkRecordInterface searchRecordsBulkImpl(int block_size = 1000, *hash<auto> where_cond, *hash<auto> search_options);
182 public:
183 
184 
186 
193 protected:
194  DbTableRecordIterator searchRecordsImpl(*hash<auto> where_cond, *hash<auto> search_options);
195 public:
196 
197 
199 
208 protected:
209  bool updateSingleRecordImpl(hash<auto> set, hash<auto> where_cond, *hash<auto> search_options);
210 public:
211 
212 
214 
223 protected:
224  int updateRecordsImpl(hash<auto> set, *hash<auto> where_cond, *hash<auto> search_options);
225 public:
226 
227 
229 
240 protected:
241  int deleteRecordsImpl(*hash<auto> where_cond, *hash<auto> search_options);
242 public:
243 
244 
246 protected:
247  hash<DataProviderInfo> getStaticInfoImpl();
248 public:
249 
250 
252  int doSequenceKey(string sequence_name);
253 
254 
256  int doSequenceCurrvalKey(string sequence_name);
257 
258 };
259 };
DbDataProvider::DbTableDataProvider::rollback
rollback()
Rolls back data written to the data provider.
DbDataProvider::DbTableDataProvider::getName
string getName()
Returns the data provider name.
DbDataProvider::DbTableDataProvider::doSequenceKey
int doSequenceKey(string sequence_name)
Processes the sequence runtime key in mappers.
DbDataProvider::DbTableDataProvider::getBulkInserter
AbstractDataProviderBulkOperation getBulkInserter()
Returns a bulk insert operation object for the data provider.
DbDataProvider::DbTableDataProvider::SearchOptions
const SearchOptions
Search options.
Definition: DbTableDataProvider.qc.dox.h:58
DbDataProvider::DbTableDataProvider::db
AbstractDatabase db
the database object, if required
Definition: DbTableDataProvider.qc.dox.h:70
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::MapperKeyInfo
const MapperKeyInfo
Mapper runtime key info.
Definition: DbTableDataProvider.qc.dox.h:42
DbDataProvider::DbTableDataProvider::requiresTransactionManagement
bool requiresTransactionManagement()
Returns True if the data provider supports transaction management.
DbDataProvider::DbTableDataProvider::CreateOptions
const CreateOptions
Create options.
Definition: DbTableDataProvider.qc.dox.h:50
DbDataProvider::DbTableDataProvider::getChildProviders
*AbstractDataProvider getChildProviders()
Returns child providers; return NOTHING if there are no child providers.
DbDataProvider::DbTableRecordIterator
Defines the record iterator class for Table-based iterators.
Definition: DbTableRecordIterator.qc.dox.h:34
DbDataProvider::DbTableDataProvider::deleteRecordsImpl
int deleteRecordsImpl(*hash< auto > where_cond, *hash< auto > search_options)
Deletes zero or more records.
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::upsertRecordImpl
string upsertRecordImpl(hash< auto > rec, *hash< auto > upsert_options)
Upserts the given record to the data provider.
DbDataProvider::DbTableDataProvider::DbUpsertMap
const DbUpsertMap
Maps SqlUtil Upsert Result Codes to DB Provider Upsert Result Codes.
Definition: DbTableDataProvider.qc.dox.h:62
DbDataProvider::DbTableDataProvider::searchSingleRecordImpl
*hash< auto > searchSingleRecordImpl(hash< auto > where_cond, *hash< auto > search_options)
Returns a single record matching the search options.
DbDataProvider::DbTableDataProvider::UpsertOptions
const UpsertOptions
Upsert options.
Definition: DbTableDataProvider.qc.dox.h:54
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::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:46
DbDataProvider::DbTableDataProvider::getBulkUpserter
AbstractDataProviderBulkOperation getBulkUpserter()
Returns a bulk upsert operation object for the data provider.
DbDataProvider::DbTableDataProvider::constructor
constructor(*hash< auto > options)
Creates the object from constructor options.
DbDataProvider::DbTableDataProvider::getStaticInfoImpl
hash< DataProviderInfo > getStaticInfoImpl()
Returns data provider static info.
DbDataProvider::DbTableDataProvider
Defines a data provider based on a single SQL table.
Definition: DbTableDataProvider.qc.dox.h:34
DbDataProvider::DbTableDataProvider::ProviderInfo
const ProviderInfo
Provider info.
Definition: DbTableDataProvider.qc.dox.h:38
DbDataProvider::DbTableDataProvider::createRecordImpl
*hash< auto > createRecordImpl(hash< auto > rec, *hash< auto > create_options)
Writes the given record to the data provider.
DbDataProvider::DbTableDataProvider::getMapperRuntimeKeys
*hash< string, hash< MapperRuntimeKeyInfo > > getMapperRuntimeKeys()
Returns custom data mapper runtime keys.
DbDataProvider
Qore AbstractDbRecordIterator class definition.
Definition: AbstractDbRecordIterator.qc.dox.h:32
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::getRecordTypeImpl
*hash< string, AbstractDataField > getRecordTypeImpl(*hash< auto > search_options)
Returns the description of the record type, if any.
DbDataProvider::DbTableDataProvider::table
AbstractTable table
the table
Definition: DbTableDataProvider.qc.dox.h:67
DbDataProvider::DbTableDataProvider::commit
commit()
Commits data written to the data provider.
DbDataProvider::DbTableDataProvider::constructor
constructor(AbstractTable table)
Creates the object.
DbDataProvider::DbTableDataProvider::db_lock
Mutex db_lock()
lock for "db"