Qore SqlUtil Module Reference  1.7.5
AbstractTable.qc.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
26 namespace SqlUtil {
28 
31 
32 public:
34 
41  const TableOptions = ...;
42 
43 
45 
50  const IndexOptions = ...;
51 
52 
54 
57 
59  const CacheOptions = ...;
60 
61 
63 
68 
69 
71 
73  const TriggerOptions = AbstractDatabase::CreationOptions;
74 
76 
79  const SelectOptions = ...;
80 
81 
83  const TableOmissionOptions = ...;
84 
85 
87 
90  const TableCreationOptions = ...;
91 
92 
94 
102  const AlignTableOptions = ...;
103 
104 
106 
118 
119 
121 
133  const ColumnDescOptions = ...;
134 
135 
137 
141 
142 
144  const ColumnOptions = {};
145 
147 
152 
153 
155 
164  const InsertOptions = ...;
165 
166 
168 
174  const UpsertOptions = ...;
175 
176 
178 
183 
184 
201 
206  const UpsertInsertFirst = 1;
207 
209 
214  const UpsertUpdateFirst = 2;
215 
217 
223  const UpsertSelectFirst = 3;
224 
226 
230  const UpsertAuto = 4;
231 
233 
237  const UpsertInsertOnly = 5;
238 
240 
244  const UpsertUpdateOnly = 6;
245 
247 
249  const UpsertStrategyMap = ...;
250 
251 
253 
256 
258 
264  const UR_Inserted = 1;
265 
267  const UR_Verified = 2;
268 
270  const UR_Updated = 3;
271 
273  const UR_Unchanged = 4;
274 
276  const UR_Deleted = 5;
278 
280 
282  const UpsertResultMap = ...;
283 
284 
286 
289 
290 
293 
294 
295 protected:
297  string name;
313  bool inDb = False;
315  bool manual = False;
316 
317  hash m_customCopMap = {};
318 
319 public:
320 
322 
330 protected:
331  constructor(AbstractDatasource nds, string nname, *hash nopts) ;
332 public:
333 
334 
337 
338 
340 
351  setDatasource(AbstractDatasource nds);
352 
353 
354 protected:
355  doTableOptions(*hash<auto> nopts);
356 public:
357 
358 
361 
362 
365 
366 
369 
370 
372 
381  bool inDb();
382 
383 
385 
393 
394 
396 
408  dropCommit(*hash<auto> opt);
409 
410 
412 
426  drop(*hash<auto> opt);
427 
428 
430  deprecated dropNoCommit(*hash<auto> opt);
431 
433 
444  auto tryExec(string sql);
445 
446 
448 
458  auto tryExecArgs(string sql, *softlist<auto> args);
459 
460 
462 
473  auto tryExecRaw(string sql);
474 
475 
477 
489  softlist<auto> getDropSql(*hash<auto> opt);
490 
491 
493 
502 
503 
505 
517 
518 
520  deprecated truncateNoCommit();
521 
523 
541  string getTruncateSql(*hash<auto> opt);
542 
543 
545 
554  createCommit(*hash<auto> opt);
555 
556 
558 
572  create(*hash<auto> opt);
573 
574 
576  deprecated createNoCommit(*hash<auto> opt);
577 
579 
595  rename(string new_name, *reference<string> sql, *Tables table_cache);
596 
597 
598 protected:
599  doRenameIntern(string new_name, *Tables table_cache);
600 public:
601 
602 
604 
615  bool emptyData();
616 
617 
619 
628  bool empty();
629 
630 
631 protected:
632  bool emptyUnlocked();
633 public:
634 
635 
637 
645  setupTable(hash<auto> desc, *hash<auto> opt);
646 
647 
649 
673  AbstractColumn addColumn(string cname, hash<auto> opt, bool nullable = True, *reference lsql);
674 
675 
677 
706  list<auto> getAddColumnSql(string cname, hash copt, bool nullable = True, *hash<auto> opt);
707 
708 
709 protected:
710  AbstractColumn addColumnUnlocked(string cname, hash<auto> opt, bool nullable = True, *reference lsql, bool do_exec = True, bool modify_table = True);
711 public:
712 
713 
714 protected:
715  addColumnToTableUnlocked(AbstractColumn c);
716 public:
717 
718 
720 
745  AbstractColumn modifyColumn(string cname, hash<auto> opt, bool nullable = True, *reference lsql);
746 
747 
749 
776  list<auto> getModifyColumnSql(string cname, hash copt, bool nullable = True, *hash<auto> opt);
777 
778 
780 
797  AbstractColumn renameColumn(string old_name, string new_name, reference<string> sql);
798 
799 
801 
819  string getRenameColumnSql(string old_name, string new_name, *hash<auto> opt);
820 
821 
822 protected:
823  AbstractColumn renameColumnIntern(AbstractColumn c, string new_name);
824 public:
825 
826 
827 protected:
828  validateOptionsIntern(string err, hash ropt, reference<hash> opt);
829 public:
830 
831 
832 protected:
833  validateOptionsIntern(string err, hash ropt, reference<hash> opt, string tag);
834 public:
835 
836 
837 protected:
838  execSql(softlist lsql);
839 public:
840 
841 
843 
863  AbstractPrimaryKey addPrimaryKey(string pkname, softlist cols, *hash<auto> opt, *reference<string> sql);
864 
865 
867 
889  string getAddPrimaryKeySql(string pkname, softlist cols, *hash pkopt, *hash<auto> opt);
890 
891 
892 protected:
893  setPrimaryKeyUnlocked(AbstractPrimaryKey pk);
894 public:
895 
896 
897 protected:
898  AbstractPrimaryKey addPrimaryKeyUnlocked(string pkname, softlist cols, *hash<auto> opt, *reference<string> sql);
899 public:
900 
901 
902 protected:
903  AbstractPrimaryKey addPrimaryKeyUnlockedIntern(string pkname, softlist cols, *hash<auto> opt, *reference<string> sql);
904 public:
905 
906 
908 
924  list<auto> getDropAllConstraintsAndIndexesOnColumnSql(string cname, *hash<auto> opt);
925 
926 
927 protected:
928  list<auto> getDropAllConstraintsAndIndexesOnColumnSqlUnlocked(string cname, *hash<auto> opt);
929 public:
930 
931 
933 
952  list<auto> getDropPrimaryKeySql(*hash<auto> opt);
953 
954 
956 
975 
976 
978 
999  AbstractUniqueConstraint addUniqueConstraint(string cname, softlist cols, *hash<auto> opt, *reference<string> sql);
1000 
1001 
1003 
1023  string getAddUniqueConstraintSql(string cname, softlist cols, *hash ukopt, *hash<auto> opt);
1024 
1025 
1026 protected:
1027  AbstractUniqueConstraint addUniqueConstraintUnlocked(string cname, softlist cols, *hash<auto> opt, *reference<string> sql);
1028 public:
1029 
1030 
1031 protected:
1032  AbstractUniqueConstraint addUniqueConstraintUnlockedIntern(string cname, softlist cols, *hash<auto> opt, *reference<string> sql);
1033 public:
1034 
1035 
1037 
1058  AbstractIndex addIndex(string iname, bool unique, softlist cols, *hash<auto> opt, *reference<string> sql);
1059 
1060 
1062 
1083  string getAddIndexSql(string iname, bool unique, softlist cols, *hash<auto> ixopt, *hash<auto> opt);
1084 
1085 
1086 protected:
1087  AbstractIndex addIndexUnlocked(string iname, bool unique, softlist cols, *hash<auto> opt, *reference<string> sql);
1088 public:
1089 
1090 
1091 protected:
1092  AbstractIndex addIndexUnlockedIntern(string iname, bool unique, softlist cols, *hash<auto> opt, *reference<string> sql);
1093 public:
1094 
1095 
1097 
1109  AbstractIndex renameIndex(string old_name, string new_name, reference<string> sql);
1110 
1111 
1113 
1131  AbstractIndex dropIndex(string iname, *reference<string> sql);
1132 
1133 
1135 
1154  string getDropIndexSql(string iname, *hash<auto> opt);
1155 
1156 
1158 
1180  AbstractForeignConstraint addForeignConstraint(string cname, softlist cols, string table, *softlist tcols, *hash<auto> opt, *reference<string> sql);
1181 
1182 
1184 
1206  string getAddForeignConstraintSql(string cname, softlist cols, string table, *softlist tcols, *hash fkopt, *hash<auto> opt);
1207 
1208 
1209 protected:
1210  Columns getReferencedTableColumnsUnlocked(string table, *Tables cache, string err = 'FOREIGN-CONSTRAINT-ERROR');
1211 public:
1212 
1213 
1214 protected:
1215  AbstractForeignConstraint addForeignConstraintUnlocked(string cname, softlist cols, string table, *softlist tcols, *hash<auto> opt, *reference<string> sql);
1216 public:
1217 
1218 
1219 protected:
1220  AbstractForeignConstraint addForeignConstraintUnlockedIntern(string cname, softlist cols, string table, *softlist tcols, *hash<auto> opt, *reference<string> sql);
1221 public:
1222 
1223 
1225 
1243  AbstractForeignConstraint dropForeignConstraint(string cname, *reference<string> sql);
1244 
1245 
1247 
1263 
1264 
1266 
1286  AbstractCheckConstraint addCheckConstraint(string cname, string src, *hash<auto> opt, *reference<string> sql);
1287 
1288 
1290 
1312  string getAddCheckConstraintSql(string cname, string src, *hash copt, *hash<auto> opt);
1313 
1314 
1315 protected:
1316  AbstractCheckConstraint addCheckConstraintUnlocked(string cname, string src, *hash<auto> opt, *reference<string> sql);
1317 public:
1318 
1319 
1320 protected:
1321  AbstractCheckConstraint addCheckConstraintUnlockedIntern(string cname, string src, *hash<auto> opt, *reference<string> sql);
1322 public:
1323 
1324 
1326 
1338  AbstractConstraint renameConstraint(string old_name, string new_name, reference lsql);
1339 
1340 
1342 
1361  string getDropConstraintSql(string cname, *hash<auto> opt);
1362 
1363 
1365 
1384  *string getDropConstraintIfExistsSql(string cname, *hash<auto> opt, *reference<AbstractConstraint> cref);
1385 
1386 
1387 protected:
1388  AbstractConstraint findDropConstraintUnlocked(string cname, reference<code> rmv);
1389 public:
1390 
1391 
1393 
1411  AbstractConstraint dropConstraint(string cname, *reference<string> sql);
1412 
1413 
1415 
1435  AbstractTrigger addTrigger(string tname, string src, *hash<auto> opt, *reference lsql);
1436 
1437 
1439 
1461  list<auto> getAddTriggerSql(string tname, string src, *hash topt, *hash<auto> opt);
1462 
1463 
1464 protected:
1465  AbstractTrigger addTriggerUnlocked(string tname, string src, *hash<auto> opt, *reference lsql);
1466 public:
1467 
1468 
1469 protected:
1470  AbstractTrigger addTriggerUnlockedIntern(string tname, string src, *hash<auto> opt, *reference lsql);
1471 public:
1472 
1473 
1475 
1493  AbstractTrigger dropTrigger(string tname, *reference<string> sql);
1494 
1495 
1497 
1516  list<auto> getDropTriggerSql(string tname, *hash<auto> opt);
1517 
1518 
1519 protected:
1520  getAllConstraintsUnlocked(*hash<auto> opt);
1521 public:
1522 
1523 
1524 protected:
1525  checkUniqueConstraintName(string err, string cname);
1526 public:
1527 
1528 
1529 protected:
1530  checkUniqueConstraintNameValidateOptions(string err, string cname, hash<auto> ropt, reference<hash> opt);
1531 public:
1532 
1533 
1535 protected:
1536  validateColumnOptions(string cname, reference<hash> opt, bool nullable);
1537 public:
1538 
1539 
1541 
1559  AbstractColumn dropColumn(string cname, *reference lsql);
1560 
1561 
1563 
1582  list<auto> getDropColumnSql(string cname, *hash<auto> opt);
1583 
1584 
1586 
1597  *hash<auto> insertCommit(hash<auto> row);
1598 
1599 
1601 
1605  *hash<auto> insertCommit(hash<auto> row, reference<string> sql);
1606 
1607 
1609 
1613  *hash<auto> insertCommit(hash<auto> row, hash<auto> opt);
1614 
1615 
1617 
1622  *hash<auto> insertCommit(hash<auto> row, reference<string> sql, hash<auto> opt);
1623 
1624 
1626 
1638  *hash<auto> insert(hash<auto> row);
1639 
1640 
1642 
1646  *hash<auto> insert(hash<auto> row, reference<string> sql);
1647 
1648 
1650 
1654  *hash<auto> insert(hash<auto> row, hash<auto> opt);
1655 
1656 
1658 
1663  *hash<auto> insert(hash<auto> row, reference<string> sql, hash<auto> opt);
1664 
1665 
1667 
1676  hash<SqlResultInfo> insertWithInfo(hash<auto> row, *hash<auto> opt);
1677 
1678 
1680  deprecated *hash<auto> insertNoCommit(hash<auto> row, *reference<string> sql, *hash<auto> opt);
1681 
1683  deprecated *hash<auto> insertNoCommit(hash<auto> row, hash<auto> opt);
1684 
1685 protected:
1686  *hash<auto> insertIntern(hash<auto> row, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
1687 public:
1688 
1689 
1690 protected:
1691  hash<auto> getPlaceholdersAndValues(hash<auto> row);
1692 public:
1693 
1694 
1696 
1700 
1701 
1703 
1722  int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh, reference<string> sql, hash<auto> opt);
1723 
1724 
1727 
1728 
1730  int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh);
1731 
1732 
1734  int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh, reference<string> sql);
1735 
1736 
1738  int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh, hash<auto> opt);
1739 
1740 
1742 
1761  int insertFromSelect(list cols, AbstractTable source, hash<auto> sh, reference<string> sql, hash<auto> opt);
1762 
1763 
1766 
1767 
1769  int insertFromSelect(list cols, AbstractTable source, hash<auto> sh);
1770 
1771 
1773  int insertFromSelect(list cols, AbstractTable source, hash<auto> sh, reference<string> sql);
1774 
1775 
1777  int insertFromSelect(list cols, AbstractTable source, hash<auto> sh, hash<auto> opt);
1778 
1779 
1781 
1794 hash<SqlResultInfo> insertFromSelectWithInfo(list<auto> cols, AbstractTable source, hash<auto> select_hash, *hash<auto> opt);
1795 
1796 
1798  deprecated int insertFromSelectNoCommit(list cols, AbstractTable source, *hash<auto> sh, *reference<string> sql, *hash<auto> opt);
1799 
1800 protected:
1801  int insertFromSelectIntern(list cols, AbstractTable source, *hash<auto> sh, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
1802 public:
1803 
1804 
1806 
1825 
1826 
1828 
1847 
1848 
1850  deprecated int insertFromIteratorNoCommit(Qore::AbstractIterator i, *hash<auto> opt);
1851 
1852 protected:
1853  int insertFromIteratorIntern(Qore::AbstractIterator i, *hash<auto> opt);
1854 public:
1855 
1856 
1858 
1874  int upsertCommit(hash<auto> row, int upsert_strategy = UpsertAuto, *hash<auto> opt);
1875 
1876 
1878 
1894  int upsert(hash<auto> row, int upsert_strategy = UpsertAuto, *hash<auto> opt);
1895 
1896 
1898  deprecated int upsertNoCommit(hash<auto> row, int upsert_strategy = UpsertAuto);
1899 
1901 
1922  code getUpsertClosure(hash<auto> row, int upsert_strategy = UpsertAuto, *hash<auto> opt);
1923 
1924 
1926 
1953  code getBulkUpsertClosure(hash example_row, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
1954 
1955 
1957 
1978  code getUpsertClosureWithValidation(hash example_row, int upsert_strategy = UpsertAuto, *hash<auto> opt);
1979 
1980 
1982 
2015 
2016 
2018 
2050  *hash upsertFromIterator(Qore::AbstractIterator i, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2051 
2052 
2054  deprecated *hash upsertFromIteratorNoCommit(Qore::AbstractIterator i, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2055 
2056 protected:
2057  *hash upsertFromIteratorIntern(Qore::AbstractIterator i, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2058 public:
2059 
2060 
2061 protected:
2062  *hash<auto> doDeleteOthersIntern(hash pkh, *hash<auto> opt);
2063 public:
2064 
2065 
2067 
2105  *hash upsertFromSelectCommit(AbstractTable t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2106 
2107 
2109  *hash upsertFromSelectCommit(Table t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2110 
2111 
2113 
2153  *hash upsertFromSelect(AbstractTable t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2154 
2155 
2157  deprecated *hash upsertFromSelectNoCommit(AbstractTable t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2158 
2160  deprecated *hash upsertFromSelect(Table t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2161 
2163  deprecated *hash upsertFromSelectNoCommit(Table t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2164 
2166 
2177  softint rowCount();
2178 
2179 
2181 
2202  Qore::SQL::SQLStatement getRowIterator(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2203 
2204 
2206 
2229  Qore::SQL::SQLStatement getRowIteratorNoExec(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2230 
2231 
2233 
2253  Qore::SQL::SQLStatement getRowIterator(*hash<auto> sh, *hash<auto> opt);
2254 
2255 
2257 
2279  Qore::SQL::AbstractSQLStatement getStatement(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2280 
2281 
2283 
2304  Qore::SQL::AbstractSQLStatement getStatement(*hash<auto> sh, *hash<auto> opt);
2305 
2306 
2308 
2340  hash<SqlResultInfo> getStatementWithInfo(*hash<auto> select_hash, *hash<auto> opt);
2341 
2342 
2344 
2366  Qore::SQL::AbstractSQLStatement getStatementNoExec(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2367 
2368 
2370 
2398  hash<SqlResultInfo> getStatementNoExecWithInfo(*hash<auto> select_hash, *hash<auto> opt);
2399 
2400 
2402 
2423  Qore::SQL::AbstractSQLStatement getStatementNoExec(*hash<auto> sh, *hash<auto> opt);
2424 
2425 
2426 protected:
2427  Qore::SQL::AbstractSQLStatement getStatementIntern(*hash<auto> sh, *reference<string> sql, *hash<auto> opt, *bool no_exec, *reference<softlist<auto>> args);
2428 public:
2429 
2430 
2432 
2451  *hash<auto> selectRow(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2452 
2453 
2454 protected:
2455  *hash<auto> selectRowIntern(*hash<auto> sh, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
2456 public:
2457 
2458 
2460 
2486  hash<SqlResultInfo> selectRowWithInfo(*hash<auto> select_hash, *hash<auto> opt);
2487 
2488 
2490 
2510  *list<auto> selectRows(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2511 
2512 
2513 protected:
2514  *list<auto> selectRowsIntern(*hash<auto> sh, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
2515 public:
2516 
2517 
2519 
2544  hash<SqlResultInfo> selectRowsWithInfo(*hash<auto> select_hash, *hash<auto> opt);
2545 
2546 
2548 
2567  *hash<auto> select(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2568 
2569 
2570 protected:
2571  *hash<auto> selectIntern(*hash<auto> sh, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
2572 public:
2573 
2574 
2576 
2601  hash<SqlResultInfo> selectWithInfo(*hash<auto> select_hash, *hash<auto> opt);
2602 
2603 
2605 
2623  *hash<auto> selectRow(*hash<auto> sh, *hash<auto> opt);
2624 
2625 
2627 
2644  *list selectRows(*hash<auto> sh, *hash<auto> opt);
2645 
2646 
2648 
2665  *hash<auto> select(*hash<auto> sh, *hash<auto> opt);
2666 
2667 
2669 
2687  string getSelectSql(*hash<auto> sh, *reference<list<auto>> args);
2688 
2689 
2690  *AbstractUniqueConstraint matchAnyUnique(list cols);
2691 
2692 
2693  string getSelectSqlIntern(*hash<auto> qh, reference<list<auto>> args, *hash<auto> opt);
2694 
2695 
2696  string getSelectSqlUnlocked(*hash<auto> qh, reference<list<auto>> args, *hash<auto> opt);
2697 
2698 
2699  // column & table information must be retrieved before calling this function
2700  string getSelectSqlUnlockedIntern(*hash<auto> qh, string from, reference<list<auto>> args, *hash<auto> ch, *hash<auto> opt);
2701 
2702 
2704  AbstractTable getSubtableFromString(string table, *hash<auto> opt);
2705 
2706 
2707 protected:
2708  string getFromIntern(string from, *hash<auto> qh);
2709 public:
2710 
2711 
2712 protected:
2713  list<auto> getGroupByListUnlocked(hash<auto> qh, *hash<auto> jch, *hash<auto> ch, *hash<auto> psch, list coll);
2714 public:
2715 
2716 
2717 protected:
2718  list<auto> getOrderByListUnlocked(hash<auto> qh, *hash<auto> jch, *hash<auto> ch, *hash<auto> psch, list coll);
2719 public:
2720 
2721 
2722 protected:
2723  list<auto> getGroupOrderByListUnlocked(string key, hash<auto> qh, *hash<auto> jch, *hash<auto> ch, *hash<auto> psch, list coll);
2724 public:
2725 
2726 
2727 protected:
2728  doForUpdate(reference<string> sql);
2729 public:
2730 
2731 
2732 protected:
2733  string getSelectSqlName(*hash<auto> qh);
2734 public:
2735 
2736 
2737 protected:
2738  string getColumnExpressionIntern(auto cvc, *hash<auto> jch, bool join, *hash<auto> ch, *hash<auto> psch);
2739 public:
2740 
2741 
2742 protected:
2743  string doColumnOperatorIntern(hash cvc, *hash<auto> jch, bool join, *hash<auto> ch, *hash<auto> psch, *reference psch_ref);
2744 public:
2745 
2746 
2747 protected:
2748  string doColumnOperatorIntern(auto cop, auto arg, *string cve, hash cm, *hash<auto> jch, bool join, *hash<auto> ch, *hash<auto> psch, *reference psch_ref);
2749 public:
2750 
2751 
2752 protected:
2753  string getColumnNameIntern(string cv, *hash<auto> jch, bool join, *hash<auto> ch, *hash<auto> psch);
2754 public:
2755 
2756 
2758 protected:
2760 public:
2761 
2762 
2763 protected:
2764  getSelectWhereSqlUnlocked(reference<string> sql, reference<list<auto>> args, *hash<auto> qh, *hash<auto> jch, bool join = False, *hash<auto> ch, *hash<auto> psch);
2765 public:
2766 
2767 
2768 protected:
2769  *string getWhereClause(*hash<auto> cond, reference<list<auto>> args, *string cprefix, *hash<auto> jch, bool join = False);
2770 public:
2771 
2772 
2773 protected:
2774  *string getWhereClause(list cond, reference<list<auto>> args, *string cprefix, *hash<auto> jch, bool join = False);
2775 public:
2776 
2777 
2778 protected:
2779  *string getWhereClauseUnlocked(list cond, reference<list<auto>> args, *string cprefix, *hash<auto> jch, bool join = False, *hash pch, *hash<auto> psch);
2780 public:
2781 
2782 
2783 protected:
2784  *string getWhereExpressionUnlocked(hash<DataProviderExpression> cond, reference<list<auto>> args, *string cprefix, *hash<auto> jch, bool join = False, *hash pch, *hash<auto> psch);
2785 public:
2786 
2787 
2788 protected:
2789  *string getWhereClauseUnlocked(*hash<auto> cond, reference<list<auto>> args, *string cprefix, *hash<auto> jch, bool join = False, *hash pch, *hash<auto> psch);
2790 public:
2791 
2792 
2793 protected:
2794  *list<string> getWhereClauseIntern(*hash<auto> cond, reference<list<auto>> args, *string cprefix, *hash<auto> jch, bool join = False, *hash<auto> ch, *hash<auto> psch, *hash<auto> opt);
2795 public:
2796 
2797 
2798 protected:
2799  string doWhereExpressionIntern(string cn, auto we, reference<list<auto>> args, *hash<auto> jch, bool join = False, *hash<auto> ch, *hash<auto> psch, *hash<auto> opt);
2800 public:
2801 
2802 
2803 string getOrClause(list<auto> arglist, reference<list<auto>> args, *hash<auto> jch, bool join = False, *hash<auto> ch, *hash<auto> psch);
2804 
2805 
2806 string getOrClause(hash<auto> arg, reference<list<auto>> args, *hash<auto> jch, bool join = False, *hash<auto> ch, *hash<auto> psch);
2807 
2808 
2809 protected:
2810  doSelectOrderBySqlUnlocked(reference<string> sql, reference<list<auto>> args, *hash<auto> qh, *hash<auto> jch, *hash<auto> ch, *hash<auto> psch, list coll);
2811 public:
2812 
2813 
2815 
2831  int delCommit(hash cond, reference<string> sql, hash<auto> opt);
2832 
2833 
2835  int delCommit(hash cond, hash<auto> opt);
2836 
2837 
2839  int delCommit(hash cond, reference<string> sql);
2840 
2841 
2843  int delCommit(hash cond);
2844 
2845 
2847  int delCommit();
2848 
2849 
2851 
2866  int del(hash cond, reference<string> sql, hash<auto> opt);
2867 
2868 
2870  int del(hash cond, hash<auto> opt);
2871 
2872 
2874  int del(hash cond, reference<string> sql);
2875 
2876 
2878  int del(hash cond);
2879 
2880 
2882  int del();
2883 
2884 
2886 
2900  hash<SqlResultInfo> delWithInfo(hash<auto> cond, *hash<auto> opt);
2901 
2902 
2904  deprecated int delNoCommit(*hash cond, *reference<string> sql);
2905 
2906 protected:
2907  int delIntern(*hash<auto> cond, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
2908 public:
2909 
2910 
2912 
2929  int updateCommit(hash set, hash cond, reference<string> sql, hash<auto> opt);
2930 
2931 
2933  int updateCommit(hash set, hash cond, reference<string> sql);
2934 
2935 
2937  int updateCommit(hash set, hash cond, hash<auto> opt);
2938 
2939 
2941  int updateCommit(hash set, hash cond);
2942 
2943 
2945  int updateCommit(hash set);
2946 
2947 
2949 
2966  int update(hash set, hash cond, reference<string> sql, hash<auto> opt);
2967 
2968 
2970  int update(hash set, hash cond, reference<string> sql);
2971 
2972 
2974  int update(hash set, hash cond, hash<auto> opt);
2975 
2976 
2978  int update(hash set, hash cond);
2979 
2980 
2982  int update(hash set);
2983 
2984 
2986 
3004  hash<SqlResultInfo> updateWithInfo(hash<auto> set, hash<auto> cond, *hash<auto> opt);
3005 
3006 
3008 
3020  hash<SqlCommandInfo> getUpdateSql(hash<auto> set, *hash<auto> cond);
3021 
3022 
3024  deprecated int updateNoCommit(hash set, *hash cond, *reference<string> sql);
3025 
3027  deprecated int updateNoCommit(hash set, *hash cond, *hash<auto> opt);
3028 
3029 protected:
3030  int updateIntern(hash<auto> set, *hash<auto> cond, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
3031 public:
3032 
3033 
3034 protected:
3035  string getUpdateExpression(string col, hash<UpdateOperatorInfo> uh);
3036 public:
3037 
3038 
3039 protected:
3040  bool emptyDataIntern();
3041 public:
3042 
3043 
3044 protected:
3045  Columns checkUpsertRow(hash<auto> row, reference<int> upsert_strategy);
3046 public:
3047 
3048 
3049 protected:
3050  code getUpsertInsertFirst(Columns cols, hash example_row, *hash<auto> opt);
3051 public:
3052 
3053 
3054 protected:
3055  code getUpsertUpdateFirst(Columns cols, hash example_row, *hash<auto> opt);
3056 public:
3057 
3058 
3059 protected:
3060  code getUpsertSelectFirst(Columns cols, hash example_row, *hash<auto> opt);
3061 public:
3062 
3063 
3064 protected:
3065  code getUpsertInsertOnly(Columns cols, hash example_row, *hash<auto> opt);
3066 public:
3067 
3068 
3069 protected:
3070  code getUpsertUpdateOnly(Columns cols, hash example_row, *hash<auto> opt);
3071 public:
3072 
3073 
3074 protected:
3075  Columns getUpsertColumns(reference<string> csrc);
3076 public:
3077 
3078 
3080 
3088 protected:
3089  hash<string, Columns> getAllUpsertColumns(*hash<auto> row);
3090 public:
3091 
3092 
3093 protected:
3094  bool matchUniqueColumns(Columns cols, hash<auto> row);
3095 public:
3096 
3097 
3098 protected:
3099  string getUpsertSelectSql(hash<auto> row, Columns cols, reference<list<string>> updc);
3100 public:
3101 
3102 
3103 protected:
3104  string getUpsertInsertSql(hash<auto> row);
3105 public:
3106 
3107 
3108 protected:
3109  string getUpsertUpdateSql(hash<auto> row, Columns cols, reference updc, *hash<auto> opt);
3110 public:
3111 
3112 
3113 protected:
3114  softbool tryUpdate(string sql, hash<auto> row, Columns cols, list updc);
3115 public:
3116 
3117 
3118 protected:
3119  checkValue(string cname, string argname, reference val, string type);
3120 public:
3121 
3122 
3124 
3133  string getSqlFromList(list<auto> l);
3134 
3135 
3137 
3148  string getSqlValue(auto v);
3149 
3150 
3152  string getName();
3153 
3154 
3156 
3163  cache(*hash<auto> opts);
3164 
3165 
3167 
3173 
3174 
3176 
3186  hash<auto> getDescriptionHash();
3187 
3188 
3190 
3198 
3199 
3201 
3210 
3211 
3213 
3223 
3224 
3225  *AbstractUniqueConstraint findUniqueConstraintUnlocked(string name);
3226 
3227 
3229 
3239 
3240 
3243 
3244 
3247 
3248 
3250 
3260 
3261 
3263 
3285  string getRenameSql(string new_name, *hash<auto> opt);
3286 
3287 
3289 
3298  string getCreateSqlString(*hash<auto> opt);
3299 
3300 
3302 
3311  list<auto> getCreateSql(*hash<auto> opt);
3312 
3313 
3315 
3326  string getCreateTableSql(*hash<auto> opt);
3327 
3328 
3330 
3335 
3336 
3337 protected:
3338  *hash<string, bool> getCheckOmissionOptions(*softlist<softstring> ol, string err);
3339 public:
3340 
3341 
3343 
3365  list<auto> getAlignSql(AbstractTable t, *hash<auto> opt);
3366 
3367 
3368 protected:
3369  list<auto> getAlignSqlUnlocked(AbstractTable t, *hash<auto> opt);
3370 public:
3371 
3372 
3373 protected:
3374  *AbstractColumnSupportingConstraint getSupportingConstraint(string ixname);
3375 public:
3376 
3377 
3378 protected:
3379  *list<AbstractColumnConstraint> getAllSupportingConstraints(string ixname);
3380 public:
3381 
3382 
3383 protected:
3384  renameIndexUnlocked(AbstractIndex ix, string new_name);
3385 public:
3386 
3387 
3389 
3402  string getAlignSqlString(AbstractTable t, *hash<auto> opt);
3403 
3404 
3406 
3418  *list<auto> getCreateIndexesSql(*hash<auto> opt, bool cache = True);
3419 
3420 
3422 
3434  *string getCreatePrimaryKeySql(*hash<auto> opt, bool cache = True);
3435 
3436 
3438 
3450  *list<auto> getCreateForeignConstraintsSql(*hash<auto> opt, bool cache = True);
3451 
3452 
3454 
3468  *list<auto> getCreateConstraintsSql(*hash<auto> opt, bool cache = True);
3469 
3470 
3472 
3484  *list<auto> getCreateMiscSql(*hash<auto> opt, bool cache = True);
3485 
3486 
3488 
3502  *list<auto> getCreateTriggersSql(*hash<auto> opt, bool cache = True);
3503 
3504 
3506 
3513  *hash find(auto id);
3514 
3515 
3517 
3528  *list find(list<auto> ids);
3529 
3530 
3531 protected:
3532  string getPrimaryKeyColumn();
3533 public:
3534 
3535 
3537 
3550  *hash<auto> find(hash<auto> row);
3551 
3552 
3554 
3567  *hash<auto> findSingle(*hash<auto> cond);
3568 
3569 
3571 
3584  *list<auto> findAll(*hash<auto> cond);
3585 
3586 
3588 
3592  string getDesc();
3593 
3594 
3596  string getBaseType();
3597 
3598 
3600  string getSqlName();
3601 
3602 
3604  string getColumnSqlName(string col);
3605 
3606 
3608  list<auto> getColumnSqlNames(softlist cols);
3609 
3610 
3612 
3615 
3616 
3618 
3622  *hash<string, AbstractDataField> getRecordType();
3623 
3624 
3626 
3635  AbstractDataField getColumnDataField(string column_name, *hash<auto> options, *string append_desc);
3636 
3637 
3639 
3647  AbstractDataField getColumnDataField(AbstractColumn column, *hash<SqlUtilDataTypeOptionInfo> options, *string append_desc);
3648 
3649 
3651 
3659  AbstractDataProviderType getColumnDataType(string column_name, *hash<SqlUtilDataTypeOptionInfo> options);
3660 
3661 
3663 
3665  AbstractDataProviderType getDbType(string native_type, *string qore_type, bool nullable, int max_size = -1, *hash<SqlUtilDataTypeOptionInfo> options);
3666 
3667 
3669 
3671  AbstractDataProviderType getNumericType(string type_name, bool nullable, *hash<auto> options);
3672 
3673 
3675 
3680 
3681 
3683 
3685  hash<auto> getWhereOperatorMap();
3686 
3687 
3689  abstract bool hasArrayBind();
3690 
3692 
3694 protected:
3695  hash<auto> getTableOptions();
3696 public:
3697 
3698 
3700 
3702 protected:
3704 public:
3705 
3706 
3708 
3710 protected:
3711  hash<auto> getConstraintOptions();
3712 public:
3713 
3714 
3716 
3718 protected:
3719  hash<auto> getCacheOptions();
3720 public:
3721 
3722 
3724 
3726 protected:
3728 public:
3729 
3730 
3732 
3734 protected:
3735  hash<auto> getAlignTableOptions();
3736 public:
3737 
3738 
3740 
3742 protected:
3744 public:
3745 
3746 
3748 
3750 protected:
3751  hash<auto> getColumnOptions();
3752 public:
3753 
3754 
3756 
3758 protected:
3759  hash<auto> getColumnDescOptions();
3760 public:
3761 
3762 
3764 
3766 protected:
3768 public:
3769 
3770 
3772 
3774 protected:
3775  hash<auto> getIndexOptions();
3776 public:
3777 
3778 
3780 
3782 protected:
3783  hash<auto> getTriggerOptions();
3784 public:
3785 
3786 
3788 
3790 protected:
3791  hash<auto> getSelectOptions();
3792 public:
3793 
3794 
3796 
3798 protected:
3799  hash<auto> getUpsertOptions();
3800 public:
3801 
3802 
3804 
3806 protected:
3807  hash<auto> getInsertOptions();
3808 public:
3809 
3810 
3812 
3814 protected:
3816 public:
3817 
3818 
3820 
3822 protected:
3824 public:
3825 
3826 
3828 
3830 protected:
3831  hash<auto> getColumnOperatorMap();
3832 public:
3833 
3834 
3836 protected:
3838 public:
3839 
3840 
3842 
3878  addCustomCopOperator(string name, hash<auto> operator);
3879 
3880 
3882 
3884  bool isDuplicateRowError(hash<ExceptionInfo> ex);
3885 
3886 
3888 
3890 protected:
3891  hash<auto> getInsertOperatorMap();
3892 public:
3893 
3894 
3896 
3898 protected:
3899  hash<auto> getUpdateOperatorMap();
3900 public:
3901 
3902 
3904 
3906 protected:
3908 public:
3909 
3910 
3912 
3914 protected:
3915  *hash<auto> getPseudoColumnHash();
3916 public:
3917 
3918 
3919 protected:
3920  string getCreateTableSqlUnlocked(*hash<auto> opt);
3921 public:
3922 
3923 
3924 protected:
3925  *list<auto> getCreateIndexesSqlUnlocked(*hash<auto> opt, bool cache = True);
3926 public:
3927 
3928 
3929 protected:
3930  *string getCreatePrimaryKeySqlUnlocked(*hash<auto> opt, bool cache = True);
3931 public:
3932 
3933 
3934 protected:
3935  *list<auto> getCreateConstraintsSqlUnlocked(*hash<auto> opt, bool cache = True);
3936 public:
3937 
3938 
3939 protected:
3940  *list<auto> getCreateForeignConstraintsSqlUnlocked(*hash<auto> opt, bool cache = True);
3941 public:
3942 
3943 
3944 protected:
3945  *list<auto> getCreateMiscSqlUnlocked(*hash<auto> opt, bool cache = True);
3946 public:
3947 
3948 
3949 protected:
3950  *list<auto> getCreateTriggersSqlUnlocked(*hash<auto> opt, bool cache = True);
3951 public:
3952 
3953 
3954 protected:
3955  list<auto> getCreateSqlUnlocked(*hash<auto> opt, bool cache = True);
3956 public:
3957 
3958 
3959 protected:
3960  cacheUnlocked(*hash<auto> opt);
3961 public:
3962 
3963 
3964 protected:
3965  auto execData(*hash<auto> opt, string sql, *list<auto> args);
3966 public:
3967 
3968 
3969 protected:
3970  execData(AbstractSQLStatement stmt, *hash<auto> opt, *list<auto> args);
3971 public:
3972 
3973 
3974  static AbstractTable getTable(AbstractDatasource nds, string nname, *hash<auto> opts);
3975 
3976  static AbstractTable getTable(string dsstr, string nname, *hash<auto> opts);
3977 
3978  static AbstractTable getTable(hash<auto> dsh, string nname, *hash<auto> opts);
3979 
3980 protected:
3981  getColumnsUnlocked();
3982 public:
3983 
3984 
3985 protected:
3986  getPrimaryKeyUnlocked();
3987 public:
3988 
3989 
3990  // also loads primary key and constraints (for unique constraints)
3991 protected:
3992  getIndexesUnlocked();
3993 public:
3994 
3995 
3996 protected:
3997  getForeignConstraintsUnlocked(*hash<auto> opt);
3998 public:
3999 
4000 
4001 protected:
4002  addSourceConstraint(string table_name, AbstractForeignConstraint fk);
4003 public:
4004 
4005 
4006 protected:
4007  getConstraintsUnlocked();
4008 public:
4009 
4010 
4011 protected:
4012  getTriggersUnlocked();
4013 public:
4014 
4015 
4017 protected:
4019 public:
4020 
4021 
4022 protected:
4023  softlist<auto> getDropSqlImpl();
4024 public:
4025 
4026 
4027 protected:
4028  string getTruncateSqlImpl();
4029 public:
4030 
4031 
4033 protected:
4034  auto tryExecArgsImpl(string sql, *softlist<auto> args);
4035 public:
4036 
4037 
4039 protected:
4040  auto tryExecRawImpl(string sql);
4041 public:
4042 
4043 
4045 protected:
4047 public:
4048 
4049 
4050 protected:
4051  preSetupTableImpl(reference desc, *hash<auto> opt);
4052 public:
4053 
4054 
4056 
4058 protected:
4059  abstract AbstractDataProviderType getNumericTypeImpl(string type_name, bool nullable, *hash<auto> options);
4060 public:
4061 
4062 protected:
4063  abstract *hash<auto> doReturningImpl(hash<auto> opt, reference<string> sql, list<auto> args);
4064 public:
4065 
4066 protected:
4067  abstract bool emptyImpl();
4068 public:
4069 
4071 protected:
4072  abstract *string getSqlValueImpl(auto v);
4073 public:
4074 
4076 
4079 protected:
4080  abstract bool checkExistenceImpl();
4081 public:
4082 
4084 protected:
4085  abstract bool supportsTablespacesImpl();
4086 public:
4087 
4089 protected:
4091 public:
4092 
4094 protected:
4096 public:
4097 
4098 protected:
4099  abstract setupTableImpl(hash<auto> desc, *hash<auto> opt);
4100 public:
4101 
4102 protected:
4103  abstract Columns describeImpl();
4104 public:
4105 protected:
4106  abstract AbstractPrimaryKey getPrimaryKeyImpl();
4107 public:
4108 protected:
4109  abstract Indexes getIndexesImpl();
4110 public:
4111 protected:
4112  abstract ForeignConstraints getForeignConstraintsImpl(*hash<auto> opt);
4113 public:
4114 protected:
4115  abstract Constraints getConstraintsImpl();
4116 public:
4117 protected:
4118  abstract Triggers getTriggersImpl();
4119 public:
4120 
4121 protected:
4122  abstract string getCreateTableSqlImpl(*hash<auto> opt);
4123 public:
4124 protected:
4125  abstract *list<auto> getCreateMiscSqlImpl(*hash<auto> opt, bool cache);
4126 public:
4127 protected:
4128  abstract string getCreateSqlImpl(list<auto> l);
4129 public:
4130 protected:
4131  abstract string getRenameSqlImpl(string new_name);
4132 public:
4133 protected:
4134  abstract *list<auto> getAlignSqlImpl(AbstractTable t, *hash<auto> opt);
4135 public:
4136 
4137 protected:
4138  abstract AbstractColumn addColumnImpl(string cname, hash<auto> opt, bool nullable = True);
4139 public:
4140 protected:
4141  abstract AbstractPrimaryKey addPrimaryKeyImpl(string cname, hash<auto> ch, *hash<auto> opt);
4142 public:
4143 protected:
4144  abstract AbstractIndex addIndexImpl(string iname, bool enabled, hash<auto> ch, *hash<auto> opt);
4145 public:
4146 protected:
4147  abstract AbstractForeignConstraint addForeignConstraintImpl(string cname, hash<auto> ch, string table, hash<auto> tch, *hash<auto> opt);
4148 public:
4149 protected:
4150  abstract AbstractCheckConstraint addCheckConstraintImpl(string cname, string src, *hash<auto> opt);
4151 public:
4152 protected:
4153  abstract AbstractUniqueConstraint addUniqueConstraintImpl(string cname, hash<auto> ch, *hash<auto> opt);
4154 public:
4155 
4156 protected:
4157  abstract AbstractTrigger addTriggerImpl(string tname, string src, *hash<auto> opt);
4158 public:
4159 
4161 protected:
4162  abstract bool tryInsertImpl(string sql, hash<auto> row);
4163 public:
4164 
4166 protected:
4167  abstract hash<auto> getQoreTypeMapImpl();
4168 public:
4169 
4171 protected:
4172  abstract hash<auto> getTypeMapImpl();
4173 public:
4174 
4176 protected:
4177  abstract doSelectOrderByWithOffsetSqlUnlockedImpl(reference<string> sql, reference<list<auto>> args, *hash<auto> qh, *hash<auto> jch, *hash<auto> ch, *hash<auto> psch, list coll);
4178 public:
4179 
4181 protected:
4182  abstract doSelectLimitOnlyUnlockedImpl(reference<string> sql, reference<list<auto>> args, *hash<auto> qh);
4183 public:
4184 
4186 protected:
4187  abstract copyImpl(AbstractTable old);
4188 public:
4189 
4191 
4195 protected:
4197 public:
4198 
4200 
4202 protected:
4203  abstract bool isDuplicateRowErrorImpl(hash<ExceptionInfo> ex);
4204 public:
4205 };
4206 };
abstract class for check constraints
Definition: SqlUtil.qm.dox.h:5709
the base class for column information
Definition: SqlUtil.qm.dox.h:5338
the API for a constraint with columns
Definition: SqlUtil.qm.dox.h:5762
abstract base class for constraints
Definition: SqlUtil.qm.dox.h:5647
the base class for foreign key constraint information
Definition: SqlUtil.qm.dox.h:5922
the abstract base class for index information
Definition: SqlUtil.qm.dox.h:5517
represents a primary key
Definition: SqlUtil.qm.dox.h:5845
Abstract base class for savepoint helpers for epheremal transaction support.
Definition: AbstractSavepointHelper.qc.dox.h:33
base class for abstract SqlUtil classes
Definition: AbstractSqlUtilBase.qc.dox.h:28
transient Mutex l()
mutex for atomic actions
*hash< auto > opts
option hash
Definition: AbstractSqlUtilBase.qc.dox.h:35
the base abstract class for the table implementation
Definition: AbstractTable.qc.dox.h:30
abstract bool constraintsLinkedToIndexesImpl()
returns True if the database links constraints to indexes (ie dropping the constraint drops the index...
const TableOptions
table options
Definition: AbstractTable.qc.dox.h:41
dropCommit(*hash< auto > opt)
drops the table from the database; releases the transaction lock after dropping the table
*hash upsertFromSelectCommit(Table t, *hash< auto > sh, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
SqlUtil::AbstractTable::upsertFromSelectCommit() variant
bool isDuplicateRowError(hash< ExceptionInfo > ex)
Returns True if the exception was raised because of a duplicate row / key error.
auto tryExecRawImpl(string sql)
tries to execute a command so that if an error occurs the current transaction status is not lost
AbstractColumn modifyColumn(string cname, hash< auto > opt, bool nullable=True, *reference lsql)
modifies an existing column in the table; if the table is already known to be in the database,...
constructor(AbstractDatasource nds, string nname, *hash nopts)
creates the object; private constructor
AbstractPrimaryKey dropPrimaryKey(*reference lsql)
drops the primary key from the table; if the table is known to be in the database already,...
abstract AbstractDataProviderType getNumericTypeImpl(string type_name, bool nullable, *hash< auto > options)
returns the type for number / numeric columns for the database so that data conversions can be handle...
softint rowCount()
returns the number of rows in the table
abstract *string getSqlValueImpl(auto v)
returns a string for use in SQL queries representing the DB-specific value of the argument; returns N...
const ColumnOptions
Column options; this is currently empty and can be extended in database-specific modules.
Definition: AbstractTable.qc.dox.h:144
const UR_Updated
row was updated because it was different (only possible with UpsertSelectFirst)
Definition: AbstractTable.qc.dox.h:270
hash< auto > getIndexOptions()
returns the index options for this driver
int update(hash set, hash cond, reference< string > sql)
A SqlUtil::AbstractTable::update() variant.
*hash< auto > selectRow(*hash< auto > sh, *reference< string > sql, *hash< auto > opt)
returns a hash representing the row in the table that matches the argument hash; if more than one row...
hash< auto > getColumnDescOptions()
returns the column description options for this driver
Columns describe()
returns an object of class Columns describing the table
const TableOmissionOptions
alignment omission options
Definition: AbstractTable.qc.dox.h:83
addCustomCopOperator(string name, hash< auto > operator)
register custom user column operator for this table object
list< auto > getDropPrimaryKeySql(*hash< auto > opt)
gets a list of SQL strings that can be used to drop the primary key from the table
int insertFromSelectCommit(list cols, AbstractTable source, hash< auto > sh, hash< auto > opt)
SqlUtil::AbstractTable::insertFromSelectCommit() variant
list< auto > getDropTriggerSql(string tname, *hash< auto > opt)
returns SQL that can be used to drop the given trigger from the table
bool hasReturningImpl()
returns True if the current database driver supports the "returning" clause in insert statements,...
abstract bool checkExistenceImpl()
returns True if the table exists in the DB, False if not
*hash< auto > insertCommit(hash< auto > row, reference< string > sql, hash< auto > opt)
SqlUtil::AbstractTable::insertCommit() variant
AbstractConstraint renameConstraint(string old_name, string new_name, reference lsql)
renames an existing constraint; this can be any constraint on the table, a primary key,...
rename(string new_name, *reference< string > sql, *Tables table_cache)
renames the table
deprecated *hash< auto > insertNoCommit(hash< auto > row, *reference< string > sql, *hash< auto > opt)
A legacy wrapper for SqlUtil::AbstractTable::insert()
*list selectRows(*hash< auto > sh, *hash< auto > opt)
returns a list of hashes representing the rows in the table that match the argument hash
*hash upsertFromIterator(Qore::AbstractIterator i, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
this method upserts or merges data from the given iterator argument (whose getValue() method must ret...
const UpsertUpdateFirst
Upsert option: update first, if the update fails, then insert.
Definition: AbstractTable.qc.dox.h:214
setupTable(hash< auto > desc, *hash< auto > opt)
creates the object from a table description hash
AbstractDataField getColumnDataField(string column_name, *hash< auto > options, *string append_desc)
returns a field object for the given column
copy(AbstractTable old)
copies the object
code getUpsertClosureWithValidation(hash example_row, int upsert_strategy=UpsertAuto, *hash< auto > opt)
returns a closure that can be executed given a hash argument representing a single row that will be u...
deprecated int updateNoCommit(hash set, *hash cond, *reference< string > sql)
A legacy SqlUtil::AbstractTable::update() wrapper.
const UpsertStrategyMap
hash mapping upsert strategy codes to a text description
Definition: AbstractTable.qc.dox.h:249
*hash upsertFromSelectCommit(AbstractTable t, *hash< auto > sh, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
this method upserts or merges data from the given foreign table and select option hash into the curre...
*hash< auto > insert(hash< auto > row)
inserts a row into the table without any transaction management; a transaction will be in progress af...
int upsertCommit(hash< auto > row, int upsert_strategy=UpsertAuto, *hash< auto > opt)
update or insert the data in the table according to the hash argument; the table must have a unique k...
AbstractColumn dropColumn(string cname, *reference lsql)
drops a column from the table
string getDropIndexSql(string iname, *hash< auto > opt)
gets the SQL that can be used to drop an index from the table
deprecated dropNoCommit(*hash< auto > opt)
A legacy wrapper for drop()
Constraints constraints
constraint descriptions
Definition: AbstractTable.qc.dox.h:307
int delCommit(hash cond)
SqlUtil::AbstractTable::delCommit() variant
deprecated createNoCommit(*hash< auto > opt)
A legacy wrapper for create()
Qore::SQL::AbstractSQLStatement getStatement(*hash< auto > sh, *reference< string > sql, *hash< auto > opt)
returns an AbstractSQLStatement object that will iterate the results of a select statement matching t...
softlist< auto > getDropSql(*hash< auto > opt)
returns the sql required to drop the table; reimplement in subclasses if necessary
int insertFromSelect(list cols, AbstractTable source)
SqlUtil::AbstractTable::insertFromSelectCommit() variant
string getDesc()
returns a descriptive string of the datasource (without the password) and the table name (with a poss...
code getBulkUpsertClosure(hash example_row, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
returns a closure that can be executed given a hash argument representing either a single row or a se...
const UpsertResultLetterMap
maps upsert result codes to single letter symbols
Definition: AbstractTable.qc.dox.h:292
AbstractPrimaryKey getPrimaryKey()
returns an object of class AbstractPrimaryKey describing the primary key of the table
int insertFromSelectCommit(list cols, AbstractTable source)
SqlUtil::AbstractTable::insertFromSelectCommit() variant
const UpsertOptions
default upsert option keys
Definition: AbstractTable.qc.dox.h:174
*hash< auto > select(*hash< auto > sh, *hash< auto > opt)
returns a hash of lists representing the columns and rows in the table that match the argument hash
auto tryExecArgs(string sql, *softlist< auto > args)
executes some SQL with optional arguments so that if an error occurs the current transaction state is...
*list< auto > getCreateTriggersSql(*hash< auto > opt, bool cache=True)
returns a list of SQL strings that could be used to create triggers on the table or NOTHING if there ...
int delCommit()
SqlUtil::AbstractTable::delCommit() variant
hash< auto > getInsertOptions()
returns the insert options for this driver
Qore::SQL::AbstractSQLStatement getStatementNoExec(*hash< auto > sh, *reference< string > sql, *hash< auto > opt)
returns an AbstractSQLStatement object that will iterate the results of a select statement matching t...
hash< auto > getSqlDataCallbackOptions()
returns the sql data operation callback options for this driver
AbstractUniqueConstraint addUniqueConstraint(string cname, softlist cols, *hash< auto > opt, *reference< string > sql)
adds a unique constraint to the table; if the table is known to be in the database already,...
const UpsertInsertOnly
Upsert option: insert if the row does not exist, otherwise ignore.
Definition: AbstractTable.qc.dox.h:237
hash< auto > getTableCreationOptions()
returns the table creation options for this driver
const UpsertInsertFirst
Upsert option: insert first, if the insert fails, then update.
Definition: AbstractTable.qc.dox.h:206
hash< auto > getUpdateOperatorMap()
returns the update operator map for this object
*list< auto > selectRows(*hash< auto > sh, *reference< string > sql, *hash< auto > opt)
returns a list of hashes representing the rows in the table that match the argument hash
AbstractColumn addColumn(string cname, hash< auto > opt, bool nullable=True, *reference lsql)
adds a column to the table; if the table is already known to be in the database, then it is added in ...
string getSqlName()
returns the name of the table to be used in SQL (with a possible qualifier for schema,...
const ColumnDescOptions
Column description options.
Definition: AbstractTable.qc.dox.h:133
string getAddUniqueConstraintSql(string cname, softlist cols, *hash ukopt, *hash< auto > opt)
returns an SQL string that can be used to add a unique constraint to the table
const UR_Verified
row was updated unconditionally (not returned with UpsertSelectFirst)
Definition: AbstractTable.qc.dox.h:267
Qore::SQL::AbstractSQLStatement getStatementNoExec(*hash< auto > sh, *hash< auto > opt)
returns an AbstractSQLStatement object that will iterate the results of a select statement matching t...
list< auto > getCreateSql(*hash< auto > opt)
returns a list of SQL strings that could be used to create the table and all known properties of the ...
bool inDb
in database
Definition: AbstractTable.qc.dox.h:313
hash< auto > getTableDescriptionHashOptions()
returns the table description hash<auto> options for this driver
string name
the table's name
Definition: AbstractTable.qc.dox.h:297
hash< SqlResultInfo > delWithInfo(hash< auto > cond, *hash< auto > opt)
deletes rows in the table matching the condition and returns the count of rows deleted; no transactio...
const IndexOptions
default index options
Definition: AbstractTable.qc.dox.h:50
hash< SqlResultInfo > getStatementNoExecWithInfo(*hash< auto > select_hash, *hash< auto > opt)
returns a result hash including an AbstractSQLStatement object that will iterate the results of a sel...
hash< SqlResultInfo > selectWithInfo(*hash< auto > select_hash, *hash< auto > opt)
returns a hash with a result key assigned to a hash of lists representing the columns and rows in the...
int delCommit(hash cond, reference< string > sql)
SqlUtil::AbstractTable::delCommit() variant
string getCreateTableSql(*hash< auto > opt)
returns an SQL string that could be used to create the basic table structure without indexes and cons...
*hash find(auto id)
finds a row in the table with the given primary key value; if no row matches the primary key value pa...
hash< SqlResultInfo > updateWithInfo(hash< auto > set, hash< auto > cond, *hash< auto > opt)
updates rows in the table matching an optional condition and returns an info hash with the count of r...
string getAddCheckConstraintSql(string cname, string src, *hash copt, *hash< auto > opt)
returns an SQL string that can be used to add a check constraint to the table
*list< auto > getCreateConstraintsSql(*hash< auto > opt, bool cache=True)
returns a list of SQL strings that could be used to create non-foreign constraints on the table or NO...
int updateCommit(hash set, hash cond, reference< string > sql, hash< auto > opt)
updates rows in the table matching an optional condition and returns the count of rows updated; the t...
string getColumnSqlName(string col)
returns the column name for use in SQL strings; subclasses can return a special string in case the co...
hash< SqlResultInfo > insertWithInfo(hash< auto > row, *hash< auto > opt)
Inserts a row and returns the result and also the SQL used.
AbstractIndex addIndex(string iname, bool unique, softlist cols, *hash< auto > opt, *reference< string > sql)
adds an index to the table; if the table is already known to be in the database, then it is added in ...
bool hasReturning()
returns True if the current database driver supports the "returning" clause in insert statements,...
int updateCommit(hash set)
A SqlUtil::AbstractTable::updateCommit() variant.
hash< auto > getUpsertOptions()
returns the upsert options for this driver
string getDropConstraintSql(string cname, *hash< auto > opt)
gets the SQL that can be used to drop a constraint from the table; this can be any constraint on the ...
deprecated int upsertNoCommit(hash< auto > row, int upsert_strategy=UpsertAuto)
A legacy SqlUtil::AbstractTable::upsert() wrapper.
bool bindEmptyStringsAsNull()
returns True if the DB treats empty strings as NULL, False if not; by default this method returns Fal...
int delCommit(hash cond, reference< string > sql, hash< auto > opt)
deletes rows in the table matching the condition and returns the count of rows deleted; the transacti...
hash< auto > getWhereOperatorMap()
returns the "where" operator map for this object
list< auto > getDropAllConstraintsAndIndexesOnColumnSql(string cname, *hash< auto > opt)
gets a list of SQL strings to drop all constraints and indexes with the given column name; if the col...
const UpsertUpdateOnly
Upsert option: update if the row exists, otherwise ignore.
Definition: AbstractTable.qc.dox.h:244
int updateCommit(hash set, hash cond, hash< auto > opt)
A SqlUtil::AbstractTable::updateCommit() variant.
hash< SqlResultInfo > selectRowWithInfo(*hash< auto > select_hash, *hash< auto > opt)
returns a hash with a result representing the row in the table that matches the argument hash; if mor...
const SqlDataCallbackOptions
generic SQL data operation callbacks
Definition: AbstractTable.qc.dox.h:151
hash< SqlCommandInfo > getUpdateSql(hash< auto > set, *hash< auto > cond)
Returns the SQL for the given update parameters.
auto tryExec(string sql)
executes some SQL with optional arguments so that if an error occurs the current transaction state is...
hash< auto > getInsertOperatorMap()
returns the insert operator map for this object
hash< auto > getCacheOptions()
returns the cache options for this driver
*hash< auto > insertCommit(hash< auto > row, reference< string > sql)
SqlUtil::AbstractTable::insertCommit() variant
const InsertOptions
generic SQL insert options
Definition: AbstractTable.qc.dox.h:164
AbstractDataField getColumnDataField(AbstractColumn column, *hash< SqlUtilDataTypeOptionInfo > options, *string append_desc)
returns a field object for the given column
deprecated int insertFromIteratorNoCommit(Qore::AbstractIterator i, *hash< auto > opt)
A legacy SqlUtil::AbstractTable::insertFromIterator() wrapper.
*list< auto > getCreateMiscSql(*hash< auto > opt, bool cache=True)
returns a list of SQL strings that could be used to create other table attributes (such as comments,...
abstract bool isDuplicateRowErrorImpl(hash< ExceptionInfo > ex)
Returns True if the exception was raised because of a duplicate row / key error.
AbstractIndex renameIndex(string old_name, string new_name, reference< string > sql)
renames an existing index; if the table is already known to be in the database, then the changes are ...
hash< string, Columns > getAllUpsertColumns(*hash< auto > row)
returns a hash with a single value\
abstract copyImpl(AbstractTable old)
db-specific copy actions
AbstractConstraint dropConstraint(string cname, *reference< string > sql)
drops a constraint from the table; this can be any constraint on the table, a primary key,...
string getRenameSql(string new_name, *hash< auto > opt)
returns an SQL string that could be used to rename the table in the database
*hash< auto > getColumnOperatorMapImpl()
Reimplement in subclasses to provide driver specific column operators.
int del(hash cond, hash< auto > opt)
SqlUtil::AbstractTable::del() variant
*hash< string, AbstractDataField > getRecordType()
returns a record description for the table
int update(hash set, hash cond, reference< string > sql, hash< auto > opt)
updates rows in the table matching an optional condition and returns the count of rows updated; no tr...
*hash< auto > insert(hash< auto > row, hash< auto > opt)
SqlUtil::AbstractTable::insert() variant
auto tryExecArgsImpl(string sql, *softlist< auto > args)
tries to execute a command so that if an error occurs the current transaction status is not lost
AbstractForeignConstraint removeForeignConstraint(string cname)
removes the named foreign constraint from the table; no SQL is executed in any case,...
const CacheOptions
default cache options
Definition: AbstractTable.qc.dox.h:59
int updateCommit(hash set, hash cond, reference< string > sql)
A SqlUtil::AbstractTable::updateCommit() variant.
string getAddIndexSql(string iname, bool unique, softlist cols, *hash< auto > ixopt, *hash< auto > opt)
returns an SQL string that can be used to add an index to the table
bool native_case
native case option
Definition: AbstractTable.qc.dox.h:311
int insertFromIterator(Qore::AbstractIterator i, *hash< auto > opt)
this method inserts data from the given iterator argument (whose getValue() method must return a hash...
list< auto > getAddColumnSql(string cname, hash copt, bool nullable=True, *hash< auto > opt)
returns a list of SQL strings that can be use to add a column to the table
int delCommit(hash cond, hash< auto > opt)
SqlUtil::AbstractTable::delCommit() variant
code getUpsertClosure(hash< auto > row, int upsert_strategy=UpsertAuto, *hash< auto > opt)
returns a closure that can be executed given a hash argument representing a single row that will be u...
hash< auto > getInsertFromIteratorOptions()
returns the insert from iterator options for this driver
int insertFromSelectCommit(list cols, AbstractTable source, hash< auto > sh, reference< string > sql)
SqlUtil::AbstractTable::insertFromSelectCommit() variant
bool asteriskRequiresPrefix()
returns True if the database requires a wildcard "*" to be prefixed with the table name when it appea...
AbstractDataProviderType getDbType(string native_type, *string qore_type, bool nullable, int max_size=-1, *hash< SqlUtilDataTypeOptionInfo > options)
returns the DB type for the given column type
bool emptyData()
returns True if the table has no data rows, False if not
*hash< auto > findSingle(*hash< auto > cond)
finds a single row in the table that match the row condition passed; multiple rows may match,...
drop(*hash< auto > opt)
drops the table from the database without any transaction management
AbstractDataProviderType getNumericType(string type_name, bool nullable, *hash< auto > options)
returns the type for number / numeric columns for the database so that data conversions can be handle...
deprecated int insertFromSelectNoCommit(list cols, AbstractTable source, *hash< auto > sh, *reference< string > sql, *hash< auto > opt)
A legacy SqlUtil::AbstractTable::insertFromSelect() wrapper.
abstract bool uniqueIndexCreatesConstraintImpl()
returns True if the database automatically creates a unique constraint when a unique index is created...
abstract hash< auto > getTypeMapImpl()
returns the type name -> type description hash
int insertFromSelectCommit(list cols, AbstractTable source, hash< auto > sh, reference< string > sql, hash< auto > opt)
inserts rows into a table based on a select statement from another table (which must be using the sam...
Columns columns
column description object
Definition: AbstractTable.qc.dox.h:299
Indexes getIndexes()
returns an object of class Indexes describing the indexes on the table
list< auto > getAddTriggerSql(string tname, string src, *hash topt, *hash< auto > opt)
returns a list of SQL strings that can be used to add a trigger to the table
*string getCreatePrimaryKeySql(*hash< auto > opt, bool cache=True)
returns an SQL string that could be used to create the primary key on the table
*list< auto > getCreateIndexesSql(*hash< auto > opt, bool cache=True)
returns a list of SQL strings that could be used to create indexes on the table or NOTHING if there a...
hash< auto > getConstraintOptions()
returns the constraint options for this driver
string getName()
returns the name of the table
*hash< auto > select(*hash< auto > sh, *reference< string > sql, *hash< auto > opt)
returns a hash of lists representing the columns and rows in the table that match the argument hash
deprecated int updateNoCommit(hash set, *hash cond, *hash< auto > opt)
A legacy SqlUtil::AbstractTable::update() wrapper.
int update(hash set, hash cond, hash< auto > opt)
A SqlUtil::AbstractTable::update() variant.
AbstractForeignConstraint dropForeignConstraint(string cname, *reference< string > sql)
drops a foreign constraint from the table; if the table is known to be in the database already,...
*hash< auto > find(hash< auto > row)
finds a row in the table with the given primary key value given as a hash; if no row matches the prim...
Triggers getTriggers()
returns an object of class Triggers describing the triggers on the table
*hash< auto > selectRow(*hash< auto > sh, *hash< auto > opt)
returns a hash representing the row in the table that matches the argument hash; if more than one row...
Qore::SQL::AbstractSQLStatement getStatement(*hash< auto > sh, *hash< auto > opt)
returns an AbstractSQLStatement object that will iterate the results of a select statement matching t...
*hash upsertFromIteratorCommit(Qore::AbstractIterator i, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
this method upserts or merges data from the given iterator argument (whose getValue() method must ret...
list< auto > getColumnSqlNames(softlist cols)
returns a list of column names for use in SQL strings; subclasses can process the argument list in ca...
ForeignConstraints foreignConstraints
foreign constraints description
Definition: AbstractTable.qc.dox.h:305
clearImpl()
clears any driver-specific table information
*hash< auto > insertCommit(hash< auto > row, hash< auto > opt)
SqlUtil::AbstractTable::insertCommit() variant
const SelectOptions
default possible select options; can be extended by driver-specific modules
Definition: AbstractTable.qc.dox.h:79
int upsert(hash< auto > row, int upsert_strategy=UpsertAuto, *hash< auto > opt)
update or insert the data in the table according to the hash argument; the table must have a unique k...
const UpsertAuto
Upsert option: if the target table is empty, use UpsertInsertFirst, otherwise use UpsertUpdateFirst.
Definition: AbstractTable.qc.dox.h:230
setDatasource(AbstractDatasource nds)
changes the datasource for the table; if the inDb flag is True, then it is set to False by calling th...
Qore::SQL::SQLStatement getRowIterator(*hash< auto > sh, *reference< string > sql, *hash< auto > opt)
returns an SQLStatement object that will iterate the results of a select statement matching the argum...
int del(hash cond)
SqlUtil::AbstractTable::del() variant
cache(*hash< auto > opts)
reads in all attributes of the table from the database
truncateCommit()
truncates all the table data; releases the transaction lock after executing
int insertFromIteratorCommit(Qore::AbstractIterator i, *hash< auto > opt)
this method inserts data from the given iterator argument (whose getValue() method must return a hash...
hash< auto > getForeignConstraintOptions()
return the foreign constraint options for this driver
const ConstraintOptions
default constraint options
Definition: AbstractTable.qc.dox.h:56
int update(hash set, hash cond)
A SqlUtil::AbstractTable::update() variant.
createCommit(*hash< auto > opt)
creates the table in the database; releases the transaction lock after creating the table
string getBaseType()
returns the base type of the underlying object (normally "table", some DB-specific implementations ma...
deprecated *hash< auto > insertNoCommit(hash< auto > row, hash< auto > opt)
A legacy wrapper for SqlUtil::AbstractTable::insert()
const TableDescriptionHashOptions
Table description options.
Definition: AbstractTable.qc.dox.h:117
const UpsertStrategyDescriptionMap
hash mapping upsert strategy descriptions to upsert strategy codes
Definition: AbstractTable.qc.dox.h:255
clear()
purges the current table definition
hash< auto > getColumnOptions()
returns the column options for this driver
list< auto > getAlignSql(AbstractTable t, *hash< auto > opt)
returns a list of SQL strings required to align the table to the table given as an argument
const UpsertResultDescriptionMap
hash mapping upsert descriptions to codes
Definition: AbstractTable.qc.dox.h:288
*hash upsertFromSelect(AbstractTable t, *hash< auto > sh, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
this method upserts or merges data from the given foreign table and select option hash into the curre...
hash< auto > getTableColumnDescOptions()
returns the table column description options for this driver
*hash< auto > getPseudoColumnHash()
returns a hash of valid pseudocolumns
string getAddPrimaryKeySql(string pkname, softlist cols, *hash pkopt, *hash< auto > opt)
returns the SQL that can be used to add a primary key to the table
*hash< auto > insert(hash< auto > row, reference< string > sql, hash< auto > opt)
SqlUtil::AbstractTable::insert() variant
Constraints getConstraints()
returns a Constraints object describing the non-foreign constraints on the table
abstract bool hasArrayBind()
returns True if the underlying DB driver supports bulk DML operations
abstract doSelectLimitOnlyUnlockedImpl(reference< string > sql, reference< list< auto >> args, *hash< auto > qh)
processes a string for use in SQL select statements when there is a "limit" argument,...
validateColumnOptions(string cname, reference< hash > opt, bool nullable)
validates column options
deprecated truncateNoCommit()
A legacy warpper for truncate()
hash< auto > getDescriptionHash()
Returns a description hash of the table.
commit()
commits the current transaction on the underlying Qore::SQL::AbstractDatasource
hash< auto > getColumnOperatorMap()
returns the column operator map for this object
hash< auto > getRawUpdateOperatorMap()
returns the raw (default) update operator map for this object
const UpsertSelectFirst
Upsert option: select first, if the row is unchanged, do nothing, if it doesn't exist,...
Definition: AbstractTable.qc.dox.h:223
bool checkExistence()
returns True if the table exists in the database, False if not
*list< auto > findAll(*hash< auto > cond)
finds all rows in the table with the given column values; a list of hashes is returned representing t...
int insertFromSelectCommit(list cols, AbstractTable source, hash< auto > sh)
SqlUtil::AbstractTable::insertFromSelectCommit() variant
deprecated *hash upsertFromSelect(Table t, *hash< auto > sh, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
SqlUtil::AbstractTable::upsertFromSelect() variant
AbstractTable getSubtableFromString(string table, *hash< auto > opt)
Returns the given table from the argument, using any "tablecode" option if present.
const TableCreationOptions
table creation options
Definition: AbstractTable.qc.dox.h:90
const UR_Deleted
row was deleted (only possible with batch upsert methods such as AbstractTable::upsertFromIterator() ...
Definition: AbstractTable.qc.dox.h:276
int insertFromSelect(list cols, AbstractTable source, hash< auto > sh, reference< string > sql, hash< auto > opt)
inserts rows into a table based on a select statement from another table (which must be using the sam...
Triggers triggers
trigger descriptions
Definition: AbstractTable.qc.dox.h:309
AbstractColumn renameColumn(string old_name, string new_name, reference< string > sql)
renames an existing column; if the table is already known to be in the database, then the changes are...
abstract AbstractSavepointHelper getSavepointHelperImpl(*string savepoint)
get DB-specific savepoint helper
AbstractDataProviderType getColumnDataType(string column_name, *hash< SqlUtilDataTypeOptionInfo > options)
returns the data type for the given column
AbstractPrimaryKey primaryKey
primary key description
Definition: AbstractTable.qc.dox.h:301
bool inDb()
returns True if the table has been read from or created in the database, False if not
Qore::SQL::SQLStatement getRowIterator(*hash< auto > sh, *hash< auto > opt)
returns an SQLStatement object that will iterate the results of a select statement matching the argum...
int insertFromSelect(list cols, AbstractTable source, hash< auto > sh, reference< string > sql)
SqlUtil::AbstractTable::insertFromSelectCommit() variant
AbstractIndex dropIndex(string iname, *reference< string > sql)
drops the given index from the table; if the table is known to be in the database already,...
hash< auto > getTableOptions()
returns the table options for this driver
list< auto > getDropColumnSql(string cname, *hash< auto > opt)
returns the SQL that can be used to drop a column from the table
abstract doSelectOrderByWithOffsetSqlUnlockedImpl(reference< string > sql, reference< list< auto >> args, *hash< auto > qh, *hash< auto > jch, *hash< auto > ch, *hash< auto > psch, list coll)
processes a string for use in SQL select statements when there is an "order by" and "offset" argument
AbstractForeignConstraint addForeignConstraint(string cname, softlist cols, string table, *softlist tcols, *hash< auto > opt, *reference< string > sql)
adds a foreign constraint to the table; if the table is already known to be in the database,...
hash< auto > getAlignTableOptions()
returns the align table options for this driver
AbstractPrimaryKey addPrimaryKey(string pkname, softlist cols, *hash< auto > opt, *reference< string > sql)
adds a primary key to the table; if the table is already known to be in the database,...
beginTransaction()
begins a transaction on the underlying Qore::SQL::AbstractDatasource
hash< SqlResultInfo > selectRowsWithInfo(*hash< auto > select_hash, *hash< auto > opt)
returns a hash with a result key assigned to a list of hashes representing the rows in the table that...
deprecated *hash upsertFromSelectNoCommit(AbstractTable t, *hash< auto > sh, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
A legacy SqlUtil::AbstractTable::upsertFromSelect() wrapper.
abstract bool supportsTablespacesImpl()
returns True if the database support tablespaces
hash< auto > getSelectOptions()
returns the select options for this driver
hash< SqlResultInfo > getStatementWithInfo(*hash< auto > select_hash, *hash< auto > opt)
returns a result hash including an AbstractSQLStatement object that will iterate the results of a sel...
rollback()
rolls back the current transaction on the underlying Qore::SQL::AbstractDatasource
string getTruncateSql(*hash< auto > opt)
gets the SQL that can be used to truncate the table
string getSqlFromList(list< auto > l)
returns an SQL string corresponding to the list of commands in the argument
*hash< auto > insert(hash< auto > row, reference< string > sql)
SqlUtil::AbstractTable::insert() variant
string getRenameColumnSql(string old_name, string new_name, *hash< auto > opt)
gets an SQL string that can be used to rename an existing column in the table
hash< auto > getTriggerOptions()
returns the trigger options for this driver
AbstractCheckConstraint addCheckConstraint(string cname, string src, *hash< auto > opt, *reference< string > sql)
adds a check constraint to the table; if the table is already known to be in the database,...
ForeignConstraints getForeignConstraints(*hash< auto > opt)
returns a ForeignConstraints object describing the foreign constraints that the table has on other ta...
string getSqlValue(auto v)
returns a string for use in SQL queries representing the DB-specific value of the argument
const TriggerOptions
default trigger options
Definition: AbstractTable.qc.dox.h:73
deprecated *hash upsertFromIteratorNoCommit(Qore::AbstractIterator i, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
A legacy SqlUtik::AbstractTable::upsertFromIterator() wrapper.
const AlignTableOptions
table alignment options
Definition: AbstractTable.qc.dox.h:102
deprecated int delNoCommit(*hash cond, *reference< string > sql)
A legacy SqlUtil::AbstractTable::del() wrapper.
int insertFromSelect(list cols, AbstractTable source, hash< auto > sh, hash< auto > opt)
SqlUtil::AbstractTable::insertFromSelectCommit() variant
int updateCommit(hash set, hash cond)
A SqlUtil::AbstractTable::updateCommit() variant.
auto tryExecRaw(string sql)
executes some SQL so that if an error occurs the current transaction state is not lost
*AbstractUniqueConstraint findUniqueConstraint(string name)
returns the given AbstractUniqueConstraint object if defined for the table (also includes the primary...
abstract hash< auto > getQoreTypeMapImpl()
returns the qore type -> column type map
string getCreateSqlString(*hash< auto > opt)
returns an SQL string that could be used to create the table and all known properties of the table
int del()
SqlUtil::AbstractTable::del() variant
const UpsertResultMap
hash mapping upsert results to a description
Definition: AbstractTable.qc.dox.h:282
AbstractSavepointHelper getSavepointHelper(*string savepoint)
get DB-specific savepoint helper
truncate()
truncates all the table data without any transaction management
AbstractTrigger dropTrigger(string tname, *reference< string > sql)
drops the given trigger from the table; if the table is known to be in the database already,...
*string getDropConstraintIfExistsSql(string cname, *hash< auto > opt, *reference< AbstractConstraint > cref)
gets the SQL that can be used to drop a constraint from the table if it exists, otherwise returns NOT...
int update(hash set)
A SqlUtil::AbstractTable::update() variant.
string getAlignSqlString(AbstractTable t, *hash< auto > opt)
accepts an AbstractTable argument and returns an SQL string that could be executed to align the struc...
AbstractTrigger addTrigger(string tname, string src, *hash< auto > opt, *reference lsql)
adds a trigger to the table; if the table is already known to be in the database, then it is added in...
string getSelectSql(*hash< auto > sh, *reference< list< auto >> args)
returns the SQL string to be executed corresponding to the argument hash with an output parameter for...
Qore::SQL::SQLStatement getRowIteratorNoExec(*hash< auto > sh, *reference< string > sql, *hash< auto > opt)
returns an SQLStatement object that will iterate the results of a select statement matching the argum...
bool manual
manual edits
Definition: AbstractTable.qc.dox.h:315
*list find(list< auto > ids)
finds rows in the table with the given primary key values; if no row matches any primary key value pa...
const UR_Inserted
row was inserted
Definition: AbstractTable.qc.dox.h:264
deprecated *hash upsertFromSelectNoCommit(Table t, *hash< auto > sh, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
A legacy SqlUtil::AbstractTable::upsertFromSelect() wrapper.
list< auto > getModifyColumnSql(string cname, hash copt, bool nullable=True, *hash< auto > opt)
gets a list of SQL strings that can be used to modify an existing column in the table
const ForeignConstraintOptions
default foreign constraint options
Definition: AbstractTable.qc.dox.h:67
const AdditionalColumnDescOptions
additional column description keys valid when describing columns in a table description hash
Definition: AbstractTable.qc.dox.h:140
const InsertFromIteratorOptions
default insert option keys
Definition: AbstractTable.qc.dox.h:182
string getAddForeignConstraintSql(string cname, softlist cols, string table, *softlist tcols, *hash fkopt, *hash< auto > opt)
returns an SQL string that can be used to add a foreign constraint to the table
bool empty()
returns True if the table has no definitions, False if not
Qore::AbstractIterator getUniqueConstraintIterator()
returns an iterator for all unique constraints on the table (including the primary key if any)
const UR_Unchanged
row was unchanged (only possible with UpsertSelectFirst, UpsertInsertOnly, and UpsertUpdateOnly)
Definition: AbstractTable.qc.dox.h:273
int del(hash cond, reference< string > sql)
SqlUtil::AbstractTable::del() variant
hash< SqlResultInfo > insertFromSelectWithInfo(list< auto > cols, AbstractTable source, hash< auto > select_hash, *hash< auto > opt)
inserts rows into a table based on a select statement from another table (which must be using the sam...
*list< auto > getCreateForeignConstraintsSql(*hash< auto > opt, bool cache=True)
returns a list of SQL strings that could be used to create foreign constraints on the table or NOTHIN...
Indexes indexes
index descriptions
Definition: AbstractTable.qc.dox.h:303
*hash< auto > insertCommit(hash< auto > row)
inserts a row into the table; the transaction is committed if successful, if an error occurs,...
int insertFromSelect(list cols, AbstractTable source, hash< auto > sh)
SqlUtil::AbstractTable::insertFromSelectCommit() variant
abstract bool tryInsertImpl(string sql, hash< auto > row)
tries to insert a row, if there is a duplicate key, then it returns False, if successful,...
int del(hash cond, reference< string > sql, hash< auto > opt)
deletes rows in the table matching the condition and returns the count of rows deleted; no transactio...
create(*hash< auto > opt)
creates the table with all associated properties (indexes, constraints, etc) without any transaction ...
the base class for triggers
Definition: SqlUtil.qm.dox.h:6120
represents a unique column constraint
Definition: SqlUtil.qm.dox.h:5836
column container class that throws an exception if an unknown column is accessed
Definition: SqlUtil.qm.dox.h:5256
constraint container class that throws an exception if an unknown constraint is accessed
Definition: SqlUtil.qm.dox.h:5605
foreign constraint container class that throws an exception if an unknown constraint is accessed
Definition: SqlUtil.qm.dox.h:5856
index container class that throws an exception if an unknown index is accessed
Definition: SqlUtil.qm.dox.h:5471
represents a database table; this class embeds an AbstractTable object that is created automatically ...
Definition: Table.qc.dox.h:44
the table container class stores a collection of tables in a schema
Definition: SqlUtil.qm.dox.h:5068
trigger container class that throws an exception if an unknown trigger is accessed
Definition: SqlUtil.qm.dox.h:6138
const True
const False
string join(string str,...)
hash< auto > hash(object obj)
string type(auto arg)
list< auto > list(...)
Qore AbstractNumericDataType class definition.
Definition: AbstractNumericDataType.qc.dox.h:31