Qore DataProvider Module Reference  2.3
AbstractDataProvider.qc.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
27 namespace DataProvider {
33 const UpsertResultInserted = "inserted";
34 
36 const UpsertResultUpdated = "updated";
37 
39 const UpsertResultVerified = "verified";
40 
42 const UpsertResultUnchanged = "unchanged";
43 
45 const UpsertResultDeleted = "deleted";
47 
49 public struct DataProviderOptionInfo {
51  softlist<AbstractDataProviderType> type;
52 
54  bool required = False;
55 
57  string desc;
58 
61 };
62 
69 const ST_Any = 1;
70 
72 const ST_Value = 2;
73 
75 
78 const ST_Field = 3;
80 
83 
84 
86 const SignatureTypeDescMap = map {$1.value: $1.key.toInt()}, SignatureTypeCodeMap.pairIterator();
87 
94 const ER_Search = (1 << 0);
95 
97 const ER_All = ER_Search;
99 
101 const RoleCodeMap = ...;
102 
103 
105 const RoleDescMap = map {$1.value: $1.key.toInt()}, RoleCodeMap.pairIterator();
106 
113 const LC_And = (1 << 0);
114 
116 const LC_Or = (1 << 1);
117 
119 const LC_All = (LC_And | LC_Or);
121 
123 const LogicCodeMap = ...;
124 
125 
127 const LogicDescMap = map {$1.value: $1.key.toInt()}, LogicCodeMap.pairIterator();
128 
133 
136 };
137 
140 
141 
144 
145 
148 
149 
152 
153 
156 
157 
160 
161 
164 
165 
168 
169 
176 const DET_Operator = 1;
177 
179 const DET_Function = 2;
181 
184 
185 
187 const ExpressionTypeDescMap = map {$1.value: $1.key.toInt()}, ExpressionTypeCodeMap.pairIterator();
188 
192  int type;
193 
195  string label;
196 
198  string name;
199 
201  string desc;
202 
204  string symbol;
205 
207 
209  int role = ER_All;
210 
212  softlist<hash<DataProviderSignatureTypeInfo>> args;
213 
216 
218  bool varargs = False;
219 };
220 
224  string field;
225 };
226 
228 public struct DataProviderExpression {
230  hash<DataProviderExpressionInfo> exp;
231 
233 
236  softlist<auto> args;
237 };
238 
240 public struct DataProviderInfo {
242 
244  string name;
245 
247 
249  string type;
250 
252 
255 
257 
260 
262 
265 
267 
270 
272 
275 
277 
280 
282 
288 
290 
296 
298 
304 
306 
309 
311 
314 
316 
319 
321 
324 
326 
329 
331 
336 
338 
343 
345 
350 
352 
357 
359 
364 
366 
371 
373 
378 
380 
383  *string schema_type;
384 
386 
388  *hash<string, hash<DataProviderOptionInfo>> constructor_options;
389 
391 
393  *hash<string, hash<DataProviderOptionInfo>> create_options;
394 
396 
398  *hash<string, hash<DataProviderOptionInfo>> upsert_options;
399 
401 
403  *hash<string, hash<DataProviderOptionInfo>> search_options;
404 
406 
408  *hash<string, hash<DataProviderOptionInfo>> request_options;
409 
411 
415  *hash<string, hash<DataProviderOptionInfo>> child_create_options;
416 
418 
422  *hash<string, hash<DataProviderOptionInfo>> child_delete_options;
423 
425 
429  *hash<string, hash<DataProviderOptionInfo>> add_field_options;
430 
432 
436  *hash<string, hash<DataProviderOptionInfo>> update_field_options;
437 
439 
443  *hash<string, hash<DataProviderOptionInfo>> delete_field_options;
444 
446 
450  *hash<string, hash<DataProviderExpressionInfo>> expressions;
451 
453 
456 
458 
462  hash<string, hash<MapperRuntimeKeyInfo>> mapper_keys = Mapper::MapperKeyInfo;
463 
465 
467  *string desc;
468 
470 
472  *list<string> children;
473 };
474 
477 
478 public:
481 
482 
484 
489  const GenericExpressions = map {$1.key: $1.value.exp}, GenericExpressionImplementations.pairIterator();
490 
491 protected:
493  Logger logger;
494 
496  static bool callbacks_locked = False;
497 
500 
502  static code cb_resolve_value;
503 
505 
511 
512 
513 public:
514 
517 
518 
521 
522 
524  setLogger(Logger logger);
525 
526 
528 
532  hash<auto> getInfoAsData(*bool with_type_info);
533 
534 
536  hash<DataProviderInfo> getInfo();
537 
538 
540  *string getDesc();
541 
542 
544 
554  *hash<auto> createRecord(hash<auto> rec, *hash<auto> create_options);
555 
556 
558 
565  string upsertRecord(hash<auto> rec, *hash<auto> upsert_options);
566 
567 
569 
576  *hash<auto> searchFirstRecord(hash<DataProviderExpression> where_cond, *hash<auto> search_options);
577 
578 
580 
585  *hash<auto> searchFirstRecord(hash<auto> where_cond, *hash<auto> search_options);
586 
587 
589 
597  *hash<auto> searchSingleRecord(hash<DataProviderExpression> where_cond, *hash<auto> search_options);
598 
599 
601 
607  *hash<auto> searchSingleRecord(hash<auto> where_cond, *hash<auto> search_options);
608 
609 
611 
616 
617 
619 
627 AbstractDataProviderBulkRecordInterface getBulkRecordInterface(int block_size = 1000, *hash<auto> search_options);
628 
629 
631 
642 AbstractDataProviderBulkRecordInterface searchRecordsBulk(int block_size = 1000, *hash<DataProviderExpression> where_cond, *hash<auto> search_options);
643 
644 
646 
655 AbstractDataProviderBulkRecordInterface searchRecordsBulk(int block_size = 1000, *hash<auto> where_cond, *hash<auto> search_options);
656 
657 
659 
666 AbstractDataProviderRecordIterator searchRecords(*hash<DataProviderExpression> where_cond, *hash<auto> search_options);
667 
668 
670 
675  AbstractDataProviderRecordIterator searchRecords(*hash<auto> where_cond, *hash<auto> search_options);
676 
677 
679 
689 AbstractDataProviderRecordIterator requestSearchRecords(auto req, *hash<DataProviderExpression> where_cond, *hash<auto> search_options);
690 
691 
693 
701 AbstractDataProviderRecordIterator requestSearchRecords(auto req, *hash<auto> where_cond, *hash<auto> search_options);
702 
703 
705 
716  bool updateSingleRecord(hash<auto> set, hash<DataProviderExpression> where_cond, *hash<auto> search_options);
717 
718 
720 
729  bool updateSingleRecord(hash<auto> set, hash<auto> where_cond, *hash<auto> search_options);
730 
731 
733 
745  int updateRecords(hash<auto> set, *hash<DataProviderExpression> where_cond, *hash<auto> search_options);
746 
747 
749 
759  int updateRecords(hash<auto> set, *hash<auto> where_cond, *hash<auto> search_options);
760 
761 
763 
775  int deleteRecords(*hash<DataProviderExpression> where_cond, *hash<auto> search_options);
776 
777 
779 
789  int deleteRecords(*hash<auto> where_cond, *hash<auto> search_options);
790 
791 
793 
801  auto doRequest(auto req, *hash<auto> request_options);
802 
803 
805 
816 AbstractDataProvider createChildProvider(string name, hash<string, AbstractDataField> fields, *hash<auto> child_create_options);
817 
818 
820 
828  deleteChildProvider(string name, *hash<auto> child_delete_options);
829 
830 
832 
841  addField(AbstractDataField field, *hash<auto> field_add_options);
842 
843 
845 
854  updateField(string name, AbstractDataField field, *hash<auto> field_update_options);
855 
856 
858 
866  deleteField(string name, *hash<auto> field_delete_options);
867 
868 
870 
876  object getSchemaObject();
877 
878 
880 
885 
886 
888 
893 
894 
896 
900  *hash<string, AbstractDataProviderType> getErrorResponseTypes();
901 
902 
904 
912 
913 
915 
917  *list<string> getChildProviderNames();
918 
919 
921 
928 
929 
931 
938 
939 
941 
950 
951 
953 
957 
958 
960 
969 
970 
972 
979 
980 
982 
989 
990 
992 
997 
998 
1000 
1005 
1006 
1008 
1012  *hash<string, hash<MapperRuntimeKeyInfo>> getMapperRuntimeKeys();
1013 
1014 
1016 
1020 
1021 
1023 
1027 
1028 
1030 
1034 
1035 
1037 
1041 
1042 
1044 
1048 
1049 
1051 
1055 
1056 
1058 
1064 
1065 
1067 
1073 
1074 
1076 
1082 
1083 
1085 
1091 
1092 
1094 
1100 
1101 
1103 
1109 
1110 
1112 
1118 
1119 
1121 
1129  *hash<auto> getSearchExpression(*hash<auto> where_cond, *hash<auto> search_options);
1130 
1131 
1133 
1136 protected:
1137  hash<DataProviderExpression> getSimpleArgumentIntern(int role, hash<DataProviderInfo> info, hash<DataProviderExpressionInfo> expinfo, string key, auto value);
1138 public:
1139 
1140 
1142 
1147 protected:
1148  hash<DataProviderExpression> getEqualityComparisonExpression(int role, hash<DataProviderInfo> info, string key, auto value);
1149 public:
1150 
1151 
1153 
1156 protected:
1157  hash<DataProviderExpressionInfo> getExpression(int role, string exp, hash<DataProviderInfo> info = getInfo());
1158 public:
1159 
1160 
1162 
1167 
1169 
1172  static auto evalGenericExpressionValue(hash<auto> rec, auto val);
1173  return rv;
1174  };
1175  if (val instanceof hash<DataProviderExpression>);
1176 
1177  return val;
1178  };
1179 
1181 
1184  static auto evalGenericExpression(hash<auto> rec, hash<DataProviderExpression> exp);
1185 
1187 
1197  static bool setDynamicValueCallbacks(code value_needs_resolution, code resolve_value);
1198 
1200 protected:
1201  static bool checkCallbacks();
1202 public:
1203 
1204 
1206 
1208 protected:
1209  *hash<auto> validateCreateOptions(*hash<auto> create_options);
1210 public:
1211 
1212 
1214 
1216 protected:
1217  *hash<auto> validateUpsertOptions(*hash<auto> upsert_options);
1218 public:
1219 
1220 
1222 
1224 protected:
1225  *hash<auto> validateSearchOptions(*hash<auto> search_options);
1226 public:
1227 
1228 
1230 
1232 protected:
1233  *hash<auto> validateRequestOptions(*hash<auto> request_options);
1234 public:
1235 
1236 
1238 
1242 protected:
1243  *hash<auto> validateChildCreateOptions(*hash<auto> child_create_options);
1244 public:
1245 
1246 
1248 
1252 protected:
1253  *hash<auto> validateChildDeleteOptions(*hash<auto> child_delete_options);
1254 public:
1255 
1256 
1258 
1262 protected:
1263  *hash<auto> validateFieldAddOptions(*hash<auto> field_add_options);
1264 public:
1265 
1266 
1268 
1272 protected:
1273  *hash<auto> validateFieldUpdateOptions(*hash<auto> field_update_options);
1274 public:
1275 
1276 
1278 
1282 protected:
1283  *hash<auto> validateFieldDeleteOptions(*hash<auto> field_delete_options);
1284 public:
1285 
1286 
1288 protected:
1289  processConstructorOptions(*hash<string, hash<DataProviderOptionInfo>> option_desc, *hash<auto> options);
1290 public:
1291 
1292 
1294 protected:
1295  *hash<auto> checkOptions(string err, *hash<string, hash<DataProviderOptionInfo>> option_desc, *hash<auto> options);
1296 public:
1297 
1298 
1300 
1305 protected:
1306  *hash<DataProviderExpression> processSearchParameters(*hash<DataProviderExpression> exp, *hash<auto> search_options);
1307 public:
1308 
1309 
1311 
1319 protected:
1320  verifyExpressionIntern(int role, hash<DataProviderInfo> info, AbstractDataProviderType expected_type, string exp, auto args);
1321 public:
1322 
1323 
1325 
1332 protected:
1333  verifyExpressionArgValue(int role, *hash<string, hash<DataProviderExpressionInfo>> expmap, int caps, hash<DataProviderExpressionInfo> expinfo, softlist<auto> values, int pos);
1334 public:
1335 
1337 
1344 protected:
1345  *hash<auto> processFieldValues(*hash<auto> h, *hash<auto> search_options);
1346 public:
1347 
1348 
1350 protected:
1351  error(string err, string fmt);
1352 public:
1353 
1354 
1356 
1361 protected:
1362  *hash<auto> searchFirstRecordImpl(hash<auto> where_cond, *hash<auto> search_options);
1363 public:
1364 
1365 
1367 
1374 protected:
1375  *hash<auto> searchSingleRecordImpl(hash<auto> where_cond, *hash<auto> search_options);
1376 public:
1377 
1378 
1380 
1384 protected:
1385  *list<string> getChildProviderNamesImpl();
1386 public:
1387 
1388 
1390 
1392 protected:
1393  *AbstractDataProvider getChildProviderImpl(string name);
1394 public:
1395 
1396 
1398 
1404  *hash<string, AbstractDataField> getRecordType(*hash<auto> search_options);
1405 
1406 
1408  *hash<string, AbstractDataField> getSoftRecordType(*hash<auto> search_options);
1409 
1410 
1412  *hash<string, AbstractDataField> getOrNothingRecordType(*hash<auto> search_options);
1413 
1414 
1416 
1419  *hash<string, hash<DataProviderOptionInfo>> getSearchOptions();
1420 
1421 
1423 
1426  *hash<string, hash<DataProviderOptionInfo>> getCreateOptions();
1427 
1428 
1430 
1433  *hash<string, hash<DataProviderOptionInfo>> getUpsertOptions();
1434 
1435 
1437 
1440  *hash<string, hash<DataProviderOptionInfo>> getRequestOptions();
1441 
1442 
1444 
1450  *hash<string, hash<DataProviderOptionInfo>> getChildCreateOptions();
1451 
1452 
1454 
1460  *hash<string, hash<DataProviderOptionInfo>> getChildDeleteOptions();
1461 
1462 
1464 
1470  *hash<string, hash<DataProviderOptionInfo>> getFieldAddOptions();
1471 
1472 
1474 
1480  *hash<string, hash<DataProviderOptionInfo>> getFieldUpdateOptions();
1481 
1482 
1484 
1490  *hash<string, hash<DataProviderOptionInfo>> getFieldDeleteOptions();
1491 
1492 
1494 
1496  bool supportsRead();
1497 
1498 
1500 
1502  bool supportsBulkRead();
1503 
1504 
1506 
1508  bool supportsCreate();
1509 
1510 
1512 
1514  bool supportsUpdate();
1515 
1516 
1518 
1520  bool supportsUpsert();
1521 
1522 
1524 
1526  bool supportsDelete();
1527 
1528 
1530 
1532  bool supportsNativeSearch();
1533 
1534 
1536 
1538  bool supportsBulkCreate();
1539 
1540 
1542 
1544  bool supportsBulkUpsert();
1545 
1546 
1548 
1550  bool supportsRequest();
1551 
1552 
1554 
1556  bool recordRequiresSearchOptions();
1557 
1558 
1560 
1562  bool hasRecord();
1563 
1564 
1566 
1568  bool supportsCreateChild();
1569 
1570 
1572 
1574  bool supportsDeleteChild();
1575 
1576 
1578 
1580  bool supportsAddField();
1581 
1582 
1584 
1586  bool supportsUpdateField();
1587 
1588 
1590 
1592  bool supportsDeleteField();
1593 
1594 
1596 
1598  bool supportsSchema();
1599 
1600 
1602 
1604  bool supportsSearchExpressions();
1605 
1606 
1608 
1610  *object getSchemaType();
1611 
1612 
1614 
1618 protected:
1619  *hash<string, AbstractDataField> getRecordTypeImpl(*hash<auto> search_options);
1620 public:
1621 
1622 
1624 
1631 protected:
1632  AbstractDataProviderBulkRecordInterface searchRecordsBulkImpl(int block_size = 1000, *hash<auto> where_cond, *hash<auto> search_options);
1633 public:
1634 
1635 
1637 
1644  /*
1645  private AbstractDataProviderBulkRecordInterface searchRecordsBulkImpl(int block_size = 1000,
1646  *hash<auto> where_cond, *hash<auto> search_options) {
1647  return new DefaultBulkRecordIterface(block_size, searchRecordsImpl(where_cond, search_options));
1648  }
1649  */
1650 
1652 
1657 protected:
1658  AbstractDataProviderRecordIterator searchRecordsImpl(hash<auto> where_cond, *hash<auto> search_options);
1659 public:
1660 
1661 
1663 
1668  /*
1669  private AbstractDataProviderRecordIterator searchRecordsImpl(*hash<auto> where_cond, *hash<auto> search_options) {
1670  throwUnimplementedException();
1671  }
1672  */
1673 
1675 
1683 protected:
1684  AbstractDataProviderRecordIterator requestSearchRecordsImpl(auto req, *hash<auto> where_cond, *hash<auto> search_options);
1685 public:
1686 
1687 
1689 
1697  /*
1698  private AbstractDataProviderRecordIterator requestSearchRecordsImpl(auto req, *hash<auto> where_cond,
1699  *hash<auto> search_options) {
1700  throwUnimplementedException();
1701  }
1702  */
1703 
1705 
1713 protected:
1714  *hash<auto> createRecordImpl(hash<auto> rec, *hash<auto> create_options);
1715 public:
1716 
1717 
1719 
1724 protected:
1725  string upsertRecordImpl(hash<auto> rec, *hash<auto> upsert_options);
1726 public:
1727 
1728 
1730 
1734 protected:
1735  bool updateSingleRecordImpl(hash<auto> set, hash<auto> where_cond, *hash<auto> search_options);
1736 public:
1737 
1738 
1740 
1744  /*
1745  private bool updateSingleRecordImpl(hash<auto> set, hash<auto> where_cond, *hash<auto> search_options) {
1746  throwUnimplementedException();
1747  }
1748  */
1749 
1751 
1757 protected:
1758  int updateRecordsImpl(hash<auto> set, *hash<auto> where_cond, *hash<auto> search_options);
1759 public:
1760 
1761 
1763 
1769  /*
1770  private int updateRecordsImpl(hash<auto> set, hash<auto> where_cond, *hash<auto> search_options) {
1771  throwUnimplementedException();
1772  }
1773  */
1774 
1776 
1782 protected:
1783  int deleteRecordsImpl(*hash<auto> where_cond, *hash<auto> search_options);
1784 public:
1785 
1786 
1788 
1794  /*
1795  private int deleteRecordsImpl(*hash<auto> where_cond, *hash<auto> search_options) {
1796  throwUnimplementedException();
1797  }
1798  */
1799 
1801 
1806 protected:
1807  auto doRequestImpl(auto req, *hash<auto> request_options);
1808 public:
1809 
1810 
1812 
1820 protected:
1821  AbstractDataProvider createChildProviderImpl(string name, hash<string, AbstractDataField> fields, *hash<auto> child_create_options);
1822 public:
1823 
1824 
1826 
1831 protected:
1832  deleteChildProviderImpl(string name, *hash<auto> child_delete_options);
1833 public:
1834 
1835 
1837 
1843 protected:
1844  addFieldImpl(AbstractDataField field, *hash<auto> field_add_options);
1845 public:
1846 
1847 
1849 
1855 protected:
1856  updateFieldImpl(string name, AbstractDataField field, *hash<auto> field_update_options);
1857 public:
1858 
1859 
1861 
1866 protected:
1867  deleteFieldImpl(string name, *hash<auto> field_delete_options);
1868 public:
1869 
1870 
1872 
1876 protected:
1877  object getSchemaObjectImpl();
1878 public:
1879 
1880 
1882 
1886 protected:
1887  *AbstractDataProviderType getRequestTypeImpl();
1888 public:
1889 
1890 
1892 
1896 protected:
1897  *AbstractDataProviderType getResponseTypeImpl();
1898 public:
1899 
1900 
1902 
1906 protected:
1907  *hash<string, AbstractDataProviderType> getErrorResponseTypesImpl();
1908 public:
1909 
1910 
1912 
1918 protected:
1919  AbstractDataProviderType getErrorResponseTypeImpl(string error_code);
1920 public:
1921 
1922 
1924 
1926 protected:
1927  throwUnimplementedException();
1928 public:
1929 
1930 
1932  abstract string getName();
1933 
1935 protected:
1936  abstract hash<DataProviderInfo> getStaticInfoImpl();
1937 public:
1938 }
1939 }
describes a data type based on a hashdecl
Definition: AbstractDataField.qc.dox.h:47
Abstract bulk data operation class.
Definition: AbstractDataProviderBulkOperation.qc.dox.h:33
Defines the abstract class for data provider iterators; the destructor releases the iterator.
Definition: AbstractDataProviderBulkRecordInterface.qc.dox.h:33
The AbstractDataProvider class.
Definition: AbstractDataProvider.qc.dox.h:476
static code cb_resolve_value
static callback for dynamic value resolution
Definition: AbstractDataProvider.qc.dox.h:502
const GenericExpressions
Generic search operator expressions.
Definition: AbstractDataProvider.qc.dox.h:489
*hash< string, hash< MapperRuntimeKeyInfo > > getMapperRuntimeKeys()
Returns custom data mapper runtime keys.
checkDeleteChild()
Ensures that the data provider supports deleting children.
deleteChildProvider(string name, *hash< auto > child_delete_options)
Deletes a child data provider.
beginTransaction()
Begins a transaction with a data provider.
Logger logger
Logger for logging.
Definition: AbstractDataProvider.qc.dox.h:493
*hash< string, AbstractDataProviderType > getErrorResponseTypes()
Returns a hash of error responses, if any.
*AbstractDataProviderType getRequestType()
Returns the description of a successful request message, if any.
hash< DataProviderExpressionInfo > getExpression(int role, string exp, hash< DataProviderInfo > info=getInfo())
Returns an expression definition for an expression code or throws an exception.
checkUpdate()
Ensures that the data provider supports record upserts.
AbstractDataProviderBulkOperation getBulkUpserter()
Returns a bulk upsert operation object for the data provider.
hash< auto > getInfoAsData(*bool with_type_info)
Returns static provider information as data; no objects are returned.
const GenericExpressionImplementations
Generic expression implementations for data providers without native search functionality.
Definition: AbstractDataProvider.qc.dox.h:480
checkUpdateField()
Ensures that the data provider supports updating fields.
*AbstractDataProvider getChildProvider(string name)
Returns the given child provider or NOTHING if the given child is unknown.
hash< DataProviderInfo > getInfo()
Returns data provider info.
const GenericRecordSearchOptions
Generic record search options; see details below.
Definition: AbstractDataProvider.qc.dox.h:510
commit()
Commits data written to the data provider.
bool updateSingleRecord(hash< auto > set, hash< DataProviderExpression > where_cond, *hash< auto > search_options)
Updates a single record matching the search options.
bool requiresTransactionManagement()
Returns True if the data provider supports transaction management.
AbstractDataProviderRecordIterator getRecordIterator(*hash< auto > search_options)
Returns an iterator iterating all records.
AbstractDataProviderBulkRecordInterface searchRecordsBulk(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()
Creates the data provider.
*hash< auto > createRecord(hash< auto > rec, *hash< auto > create_options)
Creates the given record in the data provider.
setLogger(Logger logger)
Sets or replaces the logger.
deleteField(string name, *hash< auto > field_delete_options)
Deletes an existing field.
int deleteRecords(*hash< DataProviderExpression > where_cond, *hash< auto > search_options)
Deletes zero or more records.
hash< DataProviderExpression > getSimpleArgumentIntern(int role, hash< DataProviderInfo > info, hash< DataProviderExpressionInfo > expinfo, string key, auto value)
Returns an argument for an expression.
rollback()
Rolls back data written to the data provider.
int updateRecords(hash< auto > set, *hash< DataProviderExpression > where_cond, *hash< auto > search_options)
Updates zero or more records matching the search options.
static auto evalGenericExpressionValue(hash< auto > rec, auto val)
Evaluates the given expression with the generic internal implementation and returns the result.
*hash< auto > searchFirstRecord(hash< DataProviderExpression > where_cond, *hash< auto > search_options)
Returns the first record matching the search options.
*AbstractDataProviderType getResponseType()
Returns the description of a response message, if this object represents a response message.
static bool callbacks_locked
flag if callbacks are locked
Definition: AbstractDataProvider.qc.dox.h:496
AbstractDataProviderRecordIterator requestSearchRecords(auto req, *hash< auto > where_cond, *hash< auto > search_options)
Returns an iterator for zero or more records matching the search options according to an API request.
AbstractDataProviderBulkOperation getBulkInserter()
Returns a bulk insert operation object for the data provider.
static bool setDynamicValueCallbacks()
Ensures that no callbacks can be set for dynamic URI resolution.
bool updateSingleRecord(hash< auto > set, hash< auto > where_cond, *hash< auto > search_options)
Updates a single record matching the search options.
auto doRequest(auto req, *hash< auto > request_options)
Makes a request and returns the response.
static code cb_value_needs_resolution
static callback the returns a bool if the value needs dynamic resolution
Definition: AbstractDataProvider.qc.dox.h:499
object getSchemaObject()
Returns the schema supporting this data provider.
checkCreate()
Ensures that the data provider supports record creation.
checkSchema()
Ensures that the data provider supports a schema.
checkRead()
Ensures that the data provider supports read operations.
*string getDesc()
Returns the data provider description.
*hash< auto > searchFirstRecord(hash< auto > where_cond, *hash< auto > search_options)
Returns the first record matching the search options.
AbstractDataProviderBulkRecordInterface getBulkRecordInterface(int block_size=1000, *hash< auto > search_options)
Returns an iterator iterating all records with the bulk read API.
int updateRecords(hash< auto > set, *hash< auto > where_cond, *hash< auto > search_options)
Updates zero or more records matching the search options.
*hash< auto > searchSingleRecord(hash< auto > where_cond, *hash< auto > search_options)
Returns a single record matching the search options.
*hash< auto > getSearchExpression(*hash< auto > where_cond, *hash< auto > search_options)
Returns a search expression for a standard search hash.
*hash< auto > searchSingleRecord(hash< DataProviderExpression > where_cond, *hash< auto > search_options)
Returns a single record matching the search options.
AbstractDataProviderRecordIterator searchRecords(*hash< auto > where_cond, *hash< auto > search_options)
Returns an iterator for zero or more records matching the search options.
checkDelete()
Ensures that the data provider supports record deletion.
AbstractDataProviderType getErrorResponseType(string error_code)
Returns the type for the given error code.
AbstractDataProviderRecordIterator searchRecords(*hash< DataProviderExpression > where_cond, *hash< auto > search_options)
Returns an iterator for zero or more records matching the search options.
checkDeleteField()
Ensures that the data provider supports deleting fields.
AbstractDataProvider getChildProviderPath(string path)
Returns the given child provider from a "/" separated path string.
constructor(Logger logger)
Creates the data provider with the given Logger.
*list< string > getChildProviderNames()
Returns a list of child data provider names, if any.
addField(AbstractDataField field, *hash< auto > field_add_options)
Creates a new field.
AbstractDataProvider createChildProvider(string name, hash< string, AbstractDataField > fields, *hash< auto > child_create_options)
Creates a new child data provider and returns it after adding as a child.
string upsertRecord(hash< auto > rec, *hash< auto > upsert_options)
Upserts the given record in the data provider.
updateField(string name, AbstractDataField field, *hash< auto > field_update_options)
Updates an existing field.
hash< DataProviderExpression > getEqualityComparisonExpression(int role, hash< DataProviderInfo > info, string key, auto value)
Returns an equality comparison expression.
checkRequest()
Ensures that the data provider supports the request API.
AbstractDataProvider getChildProviderEx(string name)
Returns the given child provider or throws an exception if the given child is unknown.
checkSearchExpressions()
Ensures that the data provider supports advanced search expressions.
AbstractDataProviderRecordIterator requestSearchRecords(auto req, *hash< DataProviderExpression > where_cond, *hash< auto > search_options)
Returns an iterator for zero or more records matching the search options according to an API request.
checkAddField()
Ensures that the data provider supports adding fields.
checkCreateChild()
Ensures that the data provider supports creating children.
AbstractDataProviderBulkRecordInterface searchRecordsBulk(int block_size=1000, *hash< DataProviderExpression > where_cond, *hash< auto > search_options)
Returns an iterator for zero or more records matching the search options.
int deleteRecords(*hash< auto > where_cond, *hash< auto > search_options)
Deletes zero or more records.
checkUpsert()
Ensures that the data provider supports record upserts.
Defines the abstract class for data provider iterators; the destructor releases the iterator.
Definition: AbstractDataProviderRecordIterator.qc.dox.h:288
describes a data type
Definition: AbstractDataProviderType.qc.dox.h:112
const False
number exp(number n)
hash< auto > hash(object obj)
Qore AbstractDataField class definition.
Definition: AbstractDataField.qc.dox.h:27
const UpsertResultUnchanged
Indicates that the record was left unchanged.
Definition: AbstractDataProvider.qc.dox.h:42
const UpsertResultDeleted
Indicates that the record was deleted.
Definition: AbstractDataProvider.qc.dox.h:45
const ER_All
Indicates an expression that can be used in all contexts.
Definition: AbstractDataProvider.qc.dox.h:97
const UpsertResultInserted
Indicates that the record was inserted.
Definition: AbstractDataProvider.qc.dox.h:33
const ST_Value
Indicates any literal value of the given type; i.e. not an operator or other expression.
Definition: AbstractDataProvider.qc.dox.h:72
const DataProviderSignatureOptionalIntValueType
Data provider signature *int value type.
Definition: AbstractDataProvider.qc.dox.h:155
const DataProviderSignatureStringType
Data provider signature string type.
Definition: AbstractDataProvider.qc.dox.h:167
const LC_Or
Indicates that boolean expressions can be combined with OR logic.
Definition: AbstractDataProvider.qc.dox.h:116
const ER_Search
Indicates an expression that can be used in a search operation.
Definition: AbstractDataProvider.qc.dox.h:94
const SignatureTypeDescMap
Maps signature description values to integer codes.
Definition: AbstractDataProvider.qc.dox.h:86
const SignatureTypeCodeMap
Maps signature type codes to descriptions.
Definition: AbstractDataProvider.qc.dox.h:82
const DET_Operator
Indicates an operator expression.
Definition: AbstractDataProvider.qc.dox.h:176
const LogicDescMap
Logic map from descriptions to integer codes.
Definition: AbstractDataProvider.qc.dox.h:127
const LC_And
Indicates that boolean expressions can be combined with AND logic.
Definition: AbstractDataProvider.qc.dox.h:113
const DET_Function
Indicates a function expression.
Definition: AbstractDataProvider.qc.dox.h:179
const DataProviderSignatureFieldType
Data provider signature field type.
Definition: AbstractDataProvider.qc.dox.h:139
const ExpressionTypeDescMap
Maps DataProvider expression type descriptions to integer codes.
Definition: AbstractDataProvider.qc.dox.h:187
const DataProviderSignatureBoolType
Data provider signature bool type.
Definition: AbstractDataProvider.qc.dox.h:163
const DataProviderSignatureListValueType
Data provider signature list value type.
Definition: AbstractDataProvider.qc.dox.h:159
const DataProviderSignatureStringValueType
Data provider signature string value type.
Definition: AbstractDataProvider.qc.dox.h:143
const DataProviderSignatureAnyType
Data provider signature any type.
Definition: AbstractDataProvider.qc.dox.h:147
const ST_Field
The signature type indicates a string field name when used as an argument, and the type is the field ...
Definition: AbstractDataProvider.qc.dox.h:78
const UpsertResultVerified
Indicates that the record was verified as already in the target state.
Definition: AbstractDataProvider.qc.dox.h:39
const RoleCodeMap
Role map from codes to descriptions.
Definition: AbstractDataProvider.qc.dox.h:101
const UpsertResultUpdated
Indicates that the record was updated.
Definition: AbstractDataProvider.qc.dox.h:36
const LC_All
Indicates that all logic capabilities are supported.
Definition: AbstractDataProvider.qc.dox.h:119
const ST_Any
Indicates any valid expression that returns the given type (default)
Definition: AbstractDataProvider.qc.dox.h:69
const LogicCodeMap
Logic map from codes to descriptions.
Definition: AbstractDataProvider.qc.dox.h:123
const RoleDescMap
Role map from descriptions to codes.
Definition: AbstractDataProvider.qc.dox.h:105
const ExpressionTypeCodeMap
Maps DataProvider expression type codes to descriptions.
Definition: AbstractDataProvider.qc.dox.h:183
const DataProviderSignatureIntValueType
Data provider signature int value type.
Definition: AbstractDataProvider.qc.dox.h:151
Data provider expression.
Definition: AbstractDataProvider.qc.dox.h:228
softlist< auto > args
Expression arguments.
Definition: AbstractDataProvider.qc.dox.h:236
hash< DataProviderExpressionInfo > exp
Expression info.
Definition: AbstractDataProvider.qc.dox.h:230
Data provider signature info.
Definition: AbstractDataProvider.qc.dox.h:190
string symbol
The symbol to use when rendering expressions.
Definition: AbstractDataProvider.qc.dox.h:204
string name
The display name.
Definition: AbstractDataProvider.qc.dox.h:198
string label
The label used for the expression.
Definition: AbstractDataProvider.qc.dox.h:195
bool varargs
The last argument can be repeated indefinitely.
Definition: AbstractDataProvider.qc.dox.h:218
int role
The expression role code / bitfield.
Definition: AbstractDataProvider.qc.dox.h:209
int type
The type of expression; see DataProvider Expression Type Codes.
Definition: AbstractDataProvider.qc.dox.h:192
softlist< hash< DataProviderSignatureTypeInfo > > args
Argument types.
Definition: AbstractDataProvider.qc.dox.h:212
string desc
The description of the operation.
Definition: AbstractDataProvider.qc.dox.h:201
AbstractDataProviderType return_type
The return type.
Definition: AbstractDataProvider.qc.dox.h:215
Data provider field reference.
Definition: AbstractDataProvider.qc.dox.h:222
string field
The name of the field being referenced.
Definition: AbstractDataProvider.qc.dox.h:224
Data provider info.
Definition: AbstractDataProvider.qc.dox.h:240
bool supports_delete
Does the data provider support record deletion?
Definition: AbstractDataProvider.qc.dox.h:274
bool supports_bulk_read
Does the data provider support native / optimized bulk reads?
Definition: AbstractDataProvider.qc.dox.h:287
*hash< string, hash< DataProviderOptionInfo > > add_field_options
Add field options supported by the data provider.
Definition: AbstractDataProvider.qc.dox.h:429
bool transaction_management
Does the data provider require transaction management?
Definition: AbstractDataProvider.qc.dox.h:318
*hash< string, hash< DataProviderExpressionInfo > > expressions
Expressions (operators and functions) supported by the data provider.
Definition: AbstractDataProvider.qc.dox.h:450
bool supports_child_delete
Does the data provider support deleting new child providers?
Definition: AbstractDataProvider.qc.dox.h:342
string type
The name of the provider type.
Definition: AbstractDataProvider.qc.dox.h:249
bool supports_delete_field
Does the data provider support deleting fields?
Definition: AbstractDataProvider.qc.dox.h:363
bool supports_child_create
Does the data provider support creating new child providers?
Definition: AbstractDataProvider.qc.dox.h:335
*hash< string, hash< DataProviderOptionInfo > > child_delete_options
Child deletion options supported by the data provider.
Definition: AbstractDataProvider.qc.dox.h:422
bool supports_native_search
Does the data provider support native record searching?
Definition: AbstractDataProvider.qc.dox.h:279
*hash< string, hash< DataProviderOptionInfo > > request_options
Request options supported by the data provider.
Definition: AbstractDataProvider.qc.dox.h:408
*hash< string, hash< DataProviderOptionInfo > > search_options
Search options supported by the data provider.
Definition: AbstractDataProvider.qc.dox.h:403
string name
Data provider name.
Definition: AbstractDataProvider.qc.dox.h:244
bool supports_add_field
Does the data provider support adding new fields?
Definition: AbstractDataProvider.qc.dox.h:349
bool supports_bulk_upsert
Does the data provider support native / optimized bulk upserts?
Definition: AbstractDataProvider.qc.dox.h:303
*hash< string, hash< DataProviderOptionInfo > > child_create_options
Child creation options supported by the data provider.
Definition: AbstractDataProvider.qc.dox.h:415
hash< string, hash< MapperRuntimeKeyInfo > > mapper_keys
A hash of mapper key information.
Definition: AbstractDataProvider.qc.dox.h:462
bool supports_read
Does the data provider support reading.
Definition: AbstractDataProvider.qc.dox.h:254
bool record_requires_search_options
Do we require search options to retrieve the record type?
Definition: AbstractDataProvider.qc.dox.h:328
bool supports_update
Does the data provider support record updates?
Definition: AbstractDataProvider.qc.dox.h:264
bool supports_search_expressions
Does this data provide support advanced search experssions?
Definition: AbstractDataProvider.qc.dox.h:377
*hash< string, hash< DataProviderOptionInfo > > upsert_options
Upsert options supported by the data provider.
Definition: AbstractDataProvider.qc.dox.h:398
bool supports_update_field
Does the data provider support updating existing fields?
Definition: AbstractDataProvider.qc.dox.h:356
bool supports_request
Does the data provider support the request API?
Definition: AbstractDataProvider.qc.dox.h:308
*hash< string, hash< DataProviderOptionInfo > > constructor_options
Constructor options supported by the data provider for the constructor variant taking a hash.
Definition: AbstractDataProvider.qc.dox.h:388
*hash< string, hash< DataProviderOptionInfo > > create_options
Create options supported by the data provider.
Definition: AbstractDataProvider.qc.dox.h:393
bool supports_create
Does the data provider support record creation?
Definition: AbstractDataProvider.qc.dox.h:259
*list< string > children
A list of child data providers in this data provider.
Definition: AbstractDataProvider.qc.dox.h:472
bool supports_upsert
Does the data provider support record upserts (create or update)?
Definition: AbstractDataProvider.qc.dox.h:269
bool supports_bulk_create
Does the data provider support native / optimized bulk creation?
Definition: AbstractDataProvider.qc.dox.h:295
*hash< string, hash< DataProviderOptionInfo > > delete_field_options
Delete field options supported by the data provider.
Definition: AbstractDataProvider.qc.dox.h:443
bool supports_children
Does the data provider support children?
Definition: AbstractDataProvider.qc.dox.h:313
*hash< string, hash< DataProviderOptionInfo > > update_field_options
Update field options supported by the data provider.
Definition: AbstractDataProvider.qc.dox.h:436
*string desc
A markdown description of the data provider.
Definition: AbstractDataProvider.qc.dox.h:467
bool supports_schema
Does the data provider support a schema?
Definition: AbstractDataProvider.qc.dox.h:370
int search_logic_capabilities
Supported search logic capabilities.
Definition: AbstractDataProvider.qc.dox.h:455
*string schema_type
Returns the schema type supported by this data provider.
Definition: AbstractDataProvider.qc.dox.h:383
bool has_record
Does the data provider provide a record?
Definition: AbstractDataProvider.qc.dox.h:323
Data provider option info.
Definition: AbstractDataProvider.qc.dox.h:49
softlist< AbstractDataProviderType > type
The option value type or types.
Definition: AbstractDataProvider.qc.dox.h:51
auto default_value
Any default value.
Definition: AbstractDataProvider.qc.dox.h:60
string desc
The option description.
Definition: AbstractDataProvider.qc.dox.h:57
bool required
Required flag.
Definition: AbstractDataProvider.qc.dox.h:54
Data provider signature argument info.
Definition: AbstractDataProvider.qc.dox.h:130
int type_code
The signature type code.
Definition: AbstractDataProvider.qc.dox.h:135
AbstractDataProviderType type
Argument types.
Definition: AbstractDataProvider.qc.dox.h:132