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 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 getWhereClauseUnlocked(*hash 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  *list<string> getWhereClauseIntern(*hash cond, reference<list<auto>> args, *string cprefix, *hash<auto> jch, bool join = False, *hash<auto> ch, *hash<auto> psch, *hash<auto> opt);
2790 public:
2791 
2792 
2793 protected:
2794  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);
2795 public:
2796 
2797 
2798  string getOrClause(list<auto> arglist, reference<list<auto>> args, *hash<auto> jch, bool join = False, *hash<auto> ch, *hash<auto> psch);
2799 
2800 
2801  string getOrClause(hash<auto> arg, reference<list<auto>> args, *hash<auto> jch, bool join = False, *hash<auto> ch, *hash<auto> psch);
2802 
2803 
2804 protected:
2805  doSelectOrderBySqlUnlocked(reference<string> sql, reference<list<auto>> args, *hash<auto> qh, *hash<auto> jch, *hash<auto> ch, *hash<auto> psch, list coll);
2806 public:
2807 
2808 
2810 
2825  int delCommit(hash cond, reference<string> sql, hash<auto> opt);
2826 
2827 
2829  int delCommit(hash cond, hash<auto> opt);
2830 
2831 
2833  int delCommit(hash cond, reference<string> sql);
2834 
2835 
2837  int delCommit(hash cond);
2838 
2839 
2841  int delCommit();
2842 
2843 
2845 
2860  int del(hash cond, reference<string> sql, hash<auto> opt);
2861 
2862 
2864  int del(hash cond, hash<auto> opt);
2865 
2866 
2868  int del(hash cond, reference<string> sql);
2869 
2870 
2872  int del(hash cond);
2873 
2874 
2876  int del();
2877 
2878 
2880 
2894  hash<SqlResultInfo> delWithInfo(hash<auto> cond, *hash<auto> opt);
2895 
2896 
2898  deprecated int delNoCommit(*hash cond, *reference<string> sql);
2899 
2900 protected:
2901  int delIntern(*hash<auto> cond, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
2902 public:
2903 
2904 
2906 
2923  int updateCommit(hash set, hash cond, reference<string> sql, hash<auto> opt);
2924 
2925 
2927  int updateCommit(hash set, hash cond, reference<string> sql);
2928 
2929 
2931  int updateCommit(hash set, hash cond, hash<auto> opt);
2932 
2933 
2935  int updateCommit(hash set, hash cond);
2936 
2937 
2939  int updateCommit(hash set);
2940 
2941 
2943 
2960  int update(hash set, hash cond, reference<string> sql, hash<auto> opt);
2961 
2962 
2964  int update(hash set, hash cond, reference<string> sql);
2965 
2966 
2968  int update(hash set, hash cond, hash<auto> opt);
2969 
2970 
2972  int update(hash set, hash cond);
2973 
2974 
2976  int update(hash set);
2977 
2978 
2980 
2998  hash<SqlResultInfo> updateWithInfo(hash<auto> set, hash<auto> cond, *hash<auto> opt);
2999 
3000 
3002 
3014  hash<SqlCommandInfo> getUpdateSql(hash<auto> set, *hash<auto> cond);
3015 
3016 
3018  deprecated int updateNoCommit(hash set, *hash cond, *reference<string> sql);
3019 
3021  deprecated int updateNoCommit(hash set, *hash cond, *hash<auto> opt);
3022 
3023 protected:
3024  int updateIntern(hash<auto> set, *hash<auto> cond, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
3025 public:
3026 
3027 
3028 protected:
3029  string getUpdateExpression(string col, hash<UpdateOperatorInfo> uh);
3030 public:
3031 
3032 
3033 protected:
3034  bool emptyDataIntern();
3035 public:
3036 
3037 
3038 protected:
3039  Columns checkUpsertRow(hash<auto> row, reference<int> upsert_strategy);
3040 public:
3041 
3042 
3043 protected:
3044  code getUpsertInsertFirst(Columns cols, hash example_row, *hash<auto> opt);
3045 public:
3046 
3047 
3048 protected:
3049  code getUpsertUpdateFirst(Columns cols, hash example_row, *hash<auto> opt);
3050 public:
3051 
3052 
3053 protected:
3054  code getUpsertSelectFirst(Columns cols, hash example_row, *hash<auto> opt);
3055 public:
3056 
3057 
3058 protected:
3059  code getUpsertInsertOnly(Columns cols, hash example_row, *hash<auto> opt);
3060 public:
3061 
3062 
3063 protected:
3064  code getUpsertUpdateOnly(Columns cols, hash example_row, *hash<auto> opt);
3065 public:
3066 
3067 
3068 protected:
3069  Columns getUpsertColumns(reference<string> csrc);
3070 public:
3071 
3072 
3074 
3082 protected:
3083  hash<string, Columns> getAllUpsertColumns(*hash<auto> row);
3084 public:
3085 
3086 
3087 protected:
3088  bool matchUniqueColumns(Columns cols, hash<auto> row);
3089 public:
3090 
3091 
3092 protected:
3093  string getUpsertSelectSql(hash<auto> row, Columns cols, reference<list<string>> updc);
3094 public:
3095 
3096 
3097 protected:
3098  string getUpsertInsertSql(hash<auto> row);
3099 public:
3100 
3101 
3102 protected:
3103  string getUpsertUpdateSql(hash<auto> row, Columns cols, reference updc, *hash<auto> opt);
3104 public:
3105 
3106 
3107 protected:
3108  softbool tryUpdate(string sql, hash<auto> row, Columns cols, list updc);
3109 public:
3110 
3111 
3112 protected:
3113  checkValue(string cname, string argname, reference val, string type);
3114 public:
3115 
3116 
3118 
3127  string getSqlFromList(list<auto> l);
3128 
3129 
3131 
3142  string getSqlValue(auto v);
3143 
3144 
3146  string getName();
3147 
3148 
3150 
3157  cache(*hash<auto> opts);
3158 
3159 
3161 
3167 
3168 
3170 
3180  hash<auto> getDescriptionHash();
3181 
3182 
3184 
3192 
3193 
3195 
3204 
3205 
3207 
3217 
3218 
3219  *AbstractUniqueConstraint findUniqueConstraintUnlocked(string name);
3220 
3221 
3223 
3233 
3234 
3237 
3238 
3241 
3242 
3244 
3254 
3255 
3257 
3279  string getRenameSql(string new_name, *hash<auto> opt);
3280 
3281 
3283 
3292  string getCreateSqlString(*hash<auto> opt);
3293 
3294 
3296 
3305  list<auto> getCreateSql(*hash<auto> opt);
3306 
3307 
3309 
3320  string getCreateTableSql(*hash<auto> opt);
3321 
3322 
3324 
3329 
3330 
3331 protected:
3332  *hash<string, bool> getCheckOmissionOptions(*softlist<softstring> ol, string err);
3333 public:
3334 
3335 
3337 
3359  list<auto> getAlignSql(AbstractTable t, *hash<auto> opt);
3360 
3361 
3362 protected:
3363  list<auto> getAlignSqlUnlocked(AbstractTable t, *hash<auto> opt);
3364 public:
3365 
3366 
3367 protected:
3368  *AbstractColumnSupportingConstraint getSupportingConstraint(string ixname);
3369 public:
3370 
3371 
3372 protected:
3373  *list<AbstractColumnConstraint> getAllSupportingConstraints(string ixname);
3374 public:
3375 
3376 
3377 protected:
3378  renameIndexUnlocked(AbstractIndex ix, string new_name);
3379 public:
3380 
3381 
3383 
3396  string getAlignSqlString(AbstractTable t, *hash<auto> opt);
3397 
3398 
3400 
3412  *list<auto> getCreateIndexesSql(*hash<auto> opt, bool cache = True);
3413 
3414 
3416 
3428  *string getCreatePrimaryKeySql(*hash<auto> opt, bool cache = True);
3429 
3430 
3432 
3444  *list<auto> getCreateForeignConstraintsSql(*hash<auto> opt, bool cache = True);
3445 
3446 
3448 
3462  *list<auto> getCreateConstraintsSql(*hash<auto> opt, bool cache = True);
3463 
3464 
3466 
3478  *list<auto> getCreateMiscSql(*hash<auto> opt, bool cache = True);
3479 
3480 
3482 
3496  *list<auto> getCreateTriggersSql(*hash<auto> opt, bool cache = True);
3497 
3498 
3500 
3507  *hash find(auto id);
3508 
3509 
3511 
3522  *list find(list<auto> ids);
3523 
3524 
3525 protected:
3526  string getPrimaryKeyColumn();
3527 public:
3528 
3529 
3531 
3544  *hash<auto> find(hash<auto> row);
3545 
3546 
3548 
3561  *hash<auto> findSingle(*hash<auto> cond);
3562 
3563 
3565 
3578  *list<auto> findAll(*hash<auto> cond);
3579 
3580 
3582 
3586  string getDesc();
3587 
3588 
3590  string getBaseType();
3591 
3592 
3594  string getSqlName();
3595 
3596 
3598  string getColumnSqlName(string col);
3599 
3600 
3602  list<auto> getColumnSqlNames(softlist cols);
3603 
3604 
3606 
3609 
3610 
3612 
3616  *hash<string, AbstractDataField> getRecordType();
3617 
3618 
3620 
3629  AbstractDataField getColumnDataField(string column_name, *hash<auto> options, *string append_desc);
3630 
3631 
3633 
3641  AbstractDataField getColumnDataField(AbstractColumn column, *hash<SqlUtilDataTypeOptionInfo> options, *string append_desc);
3642 
3643 
3645 
3653  AbstractDataProviderType getColumnDataType(string column_name, *hash<SqlUtilDataTypeOptionInfo> options);
3654 
3655 
3657 
3659  AbstractDataProviderType getDbType(string native_type, *string qore_type, bool nullable, int max_size = -1, *hash<SqlUtilDataTypeOptionInfo> options);
3660 
3661 
3663 
3665  AbstractDataProviderType getNumericType(string type_name, bool nullable, *hash<auto> options);
3666 
3667 
3669 
3674 
3675 
3677  abstract bool hasArrayBind();
3678 
3680 
3682 protected:
3683  hash<auto> getTableOptions();
3684 public:
3685 
3686 
3688 
3690 protected:
3692 public:
3693 
3694 
3696 
3698 protected:
3699  hash<auto> getConstraintOptions();
3700 public:
3701 
3702 
3704 
3706 protected:
3707  hash<auto> getCacheOptions();
3708 public:
3709 
3710 
3712 
3714 protected:
3716 public:
3717 
3718 
3720 
3722 protected:
3723  hash<auto> getAlignTableOptions();
3724 public:
3725 
3726 
3728 
3730 protected:
3732 public:
3733 
3734 
3736 
3738 protected:
3739  hash<auto> getColumnOptions();
3740 public:
3741 
3742 
3744 
3746 protected:
3747  hash<auto> getColumnDescOptions();
3748 public:
3749 
3750 
3752 
3754 protected:
3756 public:
3757 
3758 
3760 
3762 protected:
3763  hash<auto> getIndexOptions();
3764 public:
3765 
3766 
3768 
3770 protected:
3771  hash<auto> getTriggerOptions();
3772 public:
3773 
3774 
3776 
3778 protected:
3779  hash<auto> getSelectOptions();
3780 public:
3781 
3782 
3784 
3786 protected:
3787  hash<auto> getUpsertOptions();
3788 public:
3789 
3790 
3792 
3794 protected:
3795  hash<auto> getInsertOptions();
3796 public:
3797 
3798 
3800 
3802 protected:
3804 public:
3805 
3806 
3808 
3810 protected:
3812 public:
3813 
3814 
3816 
3818 protected:
3819  hash<auto> getWhereOperatorMap();
3820 public:
3821 
3822 
3824 
3826 protected:
3827  hash<auto> getColumnOperatorMap();
3828 public:
3829 
3830 
3832 protected:
3834 public:
3835 
3836 
3838 
3874  addCustomCopOperator(string name, hash<auto> operator);
3875 
3876 
3878 
3880  bool isDuplicateRowError(hash<ExceptionInfo> ex);
3881 
3882 
3884 
3886 protected:
3887  hash<auto> getInsertOperatorMap();
3888 public:
3889 
3890 
3892 
3894 protected:
3895  hash<auto> getUpdateOperatorMap();
3896 public:
3897 
3898 
3900 
3902 protected:
3904 public:
3905 
3906 
3908 
3910 protected:
3911  *hash<auto> getPseudoColumnHash();
3912 public:
3913 
3914 
3915 protected:
3916  string getCreateTableSqlUnlocked(*hash<auto> opt);
3917 public:
3918 
3919 
3920 protected:
3921  *list<auto> getCreateIndexesSqlUnlocked(*hash<auto> opt, bool cache = True);
3922 public:
3923 
3924 
3925 protected:
3926  *string getCreatePrimaryKeySqlUnlocked(*hash<auto> opt, bool cache = True);
3927 public:
3928 
3929 
3930 protected:
3931  *list<auto> getCreateConstraintsSqlUnlocked(*hash<auto> opt, bool cache = True);
3932 public:
3933 
3934 
3935 protected:
3936  *list<auto> getCreateForeignConstraintsSqlUnlocked(*hash<auto> opt, bool cache = True);
3937 public:
3938 
3939 
3940 protected:
3941  *list<auto> getCreateMiscSqlUnlocked(*hash<auto> opt, bool cache = True);
3942 public:
3943 
3944 
3945 protected:
3946  *list<auto> getCreateTriggersSqlUnlocked(*hash<auto> opt, bool cache = True);
3947 public:
3948 
3949 
3950 protected:
3951  list<auto> getCreateSqlUnlocked(*hash<auto> opt, bool cache = True);
3952 public:
3953 
3954 
3955 protected:
3956  cacheUnlocked(*hash<auto> opt);
3957 public:
3958 
3959 
3960 protected:
3961  auto execData(*hash<auto> opt, string sql, *list<auto> args);
3962 public:
3963 
3964 
3965 protected:
3966  execData(AbstractSQLStatement stmt, *hash<auto> opt, *list<auto> args);
3967 public:
3968 
3969 
3970  static AbstractTable getTable(AbstractDatasource nds, string nname, *hash<auto> opts);
3971 
3972  static AbstractTable getTable(string dsstr, string nname, *hash<auto> opts);
3973 
3974  static AbstractTable getTable(hash<auto> dsh, string nname, *hash<auto> opts);
3975 
3976 protected:
3977  getColumnsUnlocked();
3978 public:
3979 
3980 
3981 protected:
3982  getPrimaryKeyUnlocked();
3983 public:
3984 
3985 
3986  // also loads primary key and constraints (for unique constraints)
3987 protected:
3988  getIndexesUnlocked();
3989 public:
3990 
3991 
3992 protected:
3993  getForeignConstraintsUnlocked(*hash<auto> opt);
3994 public:
3995 
3996 
3997 protected:
3998  addSourceConstraint(string table_name, AbstractForeignConstraint fk);
3999 public:
4000 
4001 
4002 protected:
4003  getConstraintsUnlocked();
4004 public:
4005 
4006 
4007 protected:
4008  getTriggersUnlocked();
4009 public:
4010 
4011 
4013 protected:
4015 public:
4016 
4017 
4018 protected:
4019  softlist<auto> getDropSqlImpl();
4020 public:
4021 
4022 
4023 protected:
4024  string getTruncateSqlImpl();
4025 public:
4026 
4027 
4029 protected:
4030  auto tryExecArgsImpl(string sql, *softlist<auto> args);
4031 public:
4032 
4033 
4035 protected:
4036  auto tryExecRawImpl(string sql);
4037 public:
4038 
4039 
4041 protected:
4043 public:
4044 
4045 
4046 protected:
4047  preSetupTableImpl(reference desc, *hash<auto> opt);
4048 public:
4049 
4050 
4052 
4054 protected:
4055  abstract AbstractDataProviderType getNumericTypeImpl(string type_name, bool nullable, *hash<auto> options);
4056 public:
4057 
4058 protected:
4059  abstract *hash<auto> doReturningImpl(hash<auto> opt, reference<string> sql, list<auto> args);
4060 public:
4061 
4062 protected:
4063  abstract bool emptyImpl();
4064 public:
4065 
4067 protected:
4068  abstract *string getSqlValueImpl(auto v);
4069 public:
4070 
4072 
4075 protected:
4076  abstract bool checkExistenceImpl();
4077 public:
4078 
4080 protected:
4081  abstract bool supportsTablespacesImpl();
4082 public:
4083 
4085 protected:
4087 public:
4088 
4090 protected:
4092 public:
4093 
4094 protected:
4095  abstract setupTableImpl(hash<auto> desc, *hash<auto> opt);
4096 public:
4097 
4098 protected:
4099  abstract Columns describeImpl();
4100 public:
4101 protected:
4102  abstract AbstractPrimaryKey getPrimaryKeyImpl();
4103 public:
4104 protected:
4105  abstract Indexes getIndexesImpl();
4106 public:
4107 protected:
4108  abstract ForeignConstraints getForeignConstraintsImpl(*hash<auto> opt);
4109 public:
4110 protected:
4111  abstract Constraints getConstraintsImpl();
4112 public:
4113 protected:
4114  abstract Triggers getTriggersImpl();
4115 public:
4116 
4117 protected:
4118  abstract string getCreateTableSqlImpl(*hash<auto> opt);
4119 public:
4120 protected:
4121  abstract *list<auto> getCreateMiscSqlImpl(*hash<auto> opt, bool cache);
4122 public:
4123 protected:
4124  abstract string getCreateSqlImpl(list<auto> l);
4125 public:
4126 protected:
4127  abstract string getRenameSqlImpl(string new_name);
4128 public:
4129 protected:
4130  abstract *list<auto> getAlignSqlImpl(AbstractTable t, *hash<auto> opt);
4131 public:
4132 
4133 protected:
4134  abstract AbstractColumn addColumnImpl(string cname, hash<auto> opt, bool nullable = True);
4135 public:
4136 protected:
4137  abstract AbstractPrimaryKey addPrimaryKeyImpl(string cname, hash<auto> ch, *hash<auto> opt);
4138 public:
4139 protected:
4140  abstract AbstractIndex addIndexImpl(string iname, bool enabled, hash<auto> ch, *hash<auto> opt);
4141 public:
4142 protected:
4143  abstract AbstractForeignConstraint addForeignConstraintImpl(string cname, hash<auto> ch, string table, hash<auto> tch, *hash<auto> opt);
4144 public:
4145 protected:
4146  abstract AbstractCheckConstraint addCheckConstraintImpl(string cname, string src, *hash<auto> opt);
4147 public:
4148 protected:
4149  abstract AbstractUniqueConstraint addUniqueConstraintImpl(string cname, hash<auto> ch, *hash<auto> opt);
4150 public:
4151 
4152 protected:
4153  abstract AbstractTrigger addTriggerImpl(string tname, string src, *hash<auto> opt);
4154 public:
4155 
4157 protected:
4158  abstract bool tryInsertImpl(string sql, hash<auto> row);
4159 public:
4160 
4162 protected:
4163  abstract hash<auto> getQoreTypeMapImpl();
4164 public:
4165 
4167 protected:
4168  abstract hash<auto> getTypeMapImpl();
4169 public:
4170 
4172 protected:
4173  abstract doSelectOrderByWithOffsetSqlUnlockedImpl(reference<string> sql, reference<list<auto>> args, *hash<auto> qh, *hash<auto> jch, *hash<auto> ch, *hash<auto> psch, list coll);
4174 public:
4175 
4177 protected:
4178  abstract doSelectLimitOnlyUnlockedImpl(reference<string> sql, reference<list<auto>> args, *hash<auto> qh);
4179 public:
4180 
4182 protected:
4183  abstract copyImpl(AbstractTable old);
4184 public:
4185 
4187 
4191 protected:
4193 public:
4194 
4196 
4198 protected:
4199  abstract bool isDuplicateRowErrorImpl(hash<ExceptionInfo> ex);
4200 public:
4201 };
4202 };
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