Qore SqlUtil Module Reference  1.7.4
AbstractTable.qc.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
26 namespace SqlUtil {
28 
31 
32 public:
34 
38  const TableOptions = ...;
39 
40 
42 
46  const IndexOptions = ...;
47 
48 
50 
53 
55  const CacheOptions = ...;
56 
57 
59 
63 
64 
66 
69 
71 
73  const SelectOptions = ...;
74 
75 
77  const TableOmissionOptions = ...;
78 
79 
81 
84  const TableCreationOptions = ...;
85 
86 
88 
96  const AlignTableOptions = ...;
97 
98 
100 
112 
113 
115 
127  const ColumnDescOptions = ...;
128 
129 
131 
135 
136 
138  const ColumnOptions = {};
139 
141 
146 
147 
149 
158  const InsertOptions = ...;
159 
160 
162 
168  const UpsertOptions = ...;
169 
170 
172 
177 
178 
195 
200  const UpsertInsertFirst = 1;
201 
203 
208  const UpsertUpdateFirst = 2;
209 
211 
217  const UpsertSelectFirst = 3;
218 
220 
224  const UpsertAuto = 4;
225 
227 
231  const UpsertInsertOnly = 5;
232 
234 
238  const UpsertUpdateOnly = 6;
239 
241 
243  const UpsertStrategyMap = ...;
244 
245 
247 
250 
252 
258  const UR_Inserted = 1;
259 
261  const UR_Verified = 2;
262 
264  const UR_Updated = 3;
265 
267  const UR_Unchanged = 4;
268 
270  const UR_Deleted = 5;
272 
274 
276  const UpsertResultMap = ...;
277 
278 
280 
283 
284 
287 
288 
289 protected:
291  string name;
307  bool inDb = False;
309  bool manual = False;
310 
311  hash m_customCopMap = {};
312 
313 public:
314 
316 
324 protected:
325  constructor(AbstractDatasource nds, string nname, *hash nopts) ;
326 public:
327 
328 
331 
332 
334 
345  setDatasource(AbstractDatasource nds);
346 
347 
348 protected:
349  doTableOptions(*hash<auto> nopts);
350 public:
351 
352 
355 
356 
359 
360 
363 
364 
366 
375  bool inDb();
376 
377 
379 
387 
388 
390 
401  dropCommit(*hash<auto> opt);
402 
403 
405 
416  drop(*hash<auto> opt);
417 
418 
420  deprecated dropNoCommit(*hash<auto> opt);
421 
423 
434  auto tryExec(string sql);
435 
436 
438 
448  auto tryExecArgs(string sql, *softlist<auto> args);
449 
450 
452 
463  auto tryExecRaw(string sql);
464 
465 
467 
478  softlist<auto> getDropSql(*hash<auto> opt);
479 
480 
482 
490 
491 
493 
501 
502 
504  deprecated truncateNoCommit();
505 
507 
522  string getTruncateSql(*hash<auto> opt);
523 
524 
526 
535  createCommit(*hash<auto> opt);
536 
537 
539 
550  create(*hash<auto> opt);
551 
552 
554  deprecated createNoCommit(*hash<auto> opt);
555 
557 
568  rename(string new_name, *reference<string> sql, *Tables table_cache);
569 
570 
571 protected:
572  doRenameIntern(string new_name, *Tables table_cache);
573 public:
574 
575 
577 
588  bool emptyData();
589 
590 
592 
601  bool empty();
602 
603 
604 protected:
605  bool emptyUnlocked();
606 public:
607 
608 
610 
616  setupTable(hash<auto> desc, *hash<auto> opt);
617 
618 
620 
644  AbstractColumn addColumn(string cname, hash<auto> opt, bool nullable = True, *reference lsql);
645 
646 
648 
677  list<auto> getAddColumnSql(string cname, hash copt, bool nullable = True, *hash<auto> opt);
678 
679 
680 protected:
681  AbstractColumn addColumnUnlocked(string cname, hash<auto> opt, bool nullable = True, *reference lsql, bool do_exec = True, bool modify_table = True);
682 public:
683 
684 
685 protected:
686  addColumnToTableUnlocked(AbstractColumn c);
687 public:
688 
689 
691 
716  AbstractColumn modifyColumn(string cname, hash<auto> opt, bool nullable = True, *reference lsql);
717 
718 
720 
747  list<auto> getModifyColumnSql(string cname, hash copt, bool nullable = True, *hash<auto> opt);
748 
749 
751 
768  AbstractColumn renameColumn(string old_name, string new_name, reference<string> sql);
769 
770 
772 
790  string getRenameColumnSql(string old_name, string new_name, *hash<auto> opt);
791 
792 
793 protected:
794  AbstractColumn renameColumnIntern(AbstractColumn c, string new_name);
795 public:
796 
797 
798 protected:
799  validateOptionsIntern(string err, hash ropt, reference<hash> opt);
800 public:
801 
802 
803 protected:
804  validateOptionsIntern(string err, hash ropt, reference<hash> opt, string tag);
805 public:
806 
807 
808 protected:
809  execSql(softlist lsql);
810 public:
811 
812 
814 
834  AbstractPrimaryKey addPrimaryKey(string pkname, softlist cols, *hash<auto> opt, *reference<string> sql);
835 
836 
838 
860  string getAddPrimaryKeySql(string pkname, softlist cols, *hash pkopt, *hash<auto> opt);
861 
862 
863 protected:
864  setPrimaryKeyUnlocked(AbstractPrimaryKey pk);
865 public:
866 
867 
868 protected:
869  AbstractPrimaryKey addPrimaryKeyUnlocked(string pkname, softlist cols, *hash<auto> opt, *reference<string> sql);
870 public:
871 
872 
873 protected:
874  AbstractPrimaryKey addPrimaryKeyUnlockedIntern(string pkname, softlist cols, *hash<auto> opt, *reference<string> sql);
875 public:
876 
877 
879 
895  list<auto> getDropAllConstraintsAndIndexesOnColumnSql(string cname, *hash<auto> opt);
896 
897 
898 protected:
899  list<auto> getDropAllConstraintsAndIndexesOnColumnSqlUnlocked(string cname, *hash<auto> opt);
900 public:
901 
902 
904 
923  list<auto> getDropPrimaryKeySql(*hash<auto> opt);
924 
925 
927 
946 
947 
949 
970  AbstractUniqueConstraint addUniqueConstraint(string cname, softlist cols, *hash<auto> opt, *reference<string> sql);
971 
972 
974 
994  string getAddUniqueConstraintSql(string cname, softlist cols, *hash ukopt, *hash<auto> opt);
995 
996 
997 protected:
998  AbstractUniqueConstraint addUniqueConstraintUnlocked(string cname, softlist cols, *hash<auto> opt, *reference<string> sql);
999 public:
1000 
1001 
1002 protected:
1003  AbstractUniqueConstraint addUniqueConstraintUnlockedIntern(string cname, softlist cols, *hash<auto> opt, *reference<string> sql);
1004 public:
1005 
1006 
1008 
1029  AbstractIndex addIndex(string iname, bool unique, softlist cols, *hash<auto> opt, *reference<string> sql);
1030 
1031 
1033 
1054  string getAddIndexSql(string iname, bool unique, softlist cols, *hash<auto> ixopt, *hash<auto> opt);
1055 
1056 
1057 protected:
1058  AbstractIndex addIndexUnlocked(string iname, bool unique, softlist cols, *hash<auto> opt, *reference<string> sql);
1059 public:
1060 
1061 
1062 protected:
1063  AbstractIndex addIndexUnlockedIntern(string iname, bool unique, softlist cols, *hash<auto> opt, *reference<string> sql);
1064 public:
1065 
1066 
1068 
1080  AbstractIndex renameIndex(string old_name, string new_name, reference<string> sql);
1081 
1082 
1084 
1102  AbstractIndex dropIndex(string iname, *reference<string> sql);
1103 
1104 
1106 
1125  string getDropIndexSql(string iname, *hash<auto> opt);
1126 
1127 
1129 
1151  AbstractForeignConstraint addForeignConstraint(string cname, softlist cols, string table, *softlist tcols, *hash<auto> opt, *reference<string> sql);
1152 
1153 
1155 
1177  string getAddForeignConstraintSql(string cname, softlist cols, string table, *softlist tcols, *hash fkopt, *hash<auto> opt);
1178 
1179 
1180 protected:
1181  Columns getReferencedTableColumnsUnlocked(string table, *Tables cache, string err = 'FOREIGN-CONSTRAINT-ERROR');
1182 public:
1183 
1184 
1185 protected:
1186  AbstractForeignConstraint addForeignConstraintUnlocked(string cname, softlist cols, string table, *softlist tcols, *hash<auto> opt, *reference<string> sql);
1187 public:
1188 
1189 
1190 protected:
1191  AbstractForeignConstraint addForeignConstraintUnlockedIntern(string cname, softlist cols, string table, *softlist tcols, *hash<auto> opt, *reference<string> sql);
1192 public:
1193 
1194 
1196 
1214  AbstractForeignConstraint dropForeignConstraint(string cname, *reference<string> sql);
1215 
1216 
1218 
1234 
1235 
1237 
1257  AbstractCheckConstraint addCheckConstraint(string cname, string src, *hash<auto> opt, *reference<string> sql);
1258 
1259 
1261 
1283  string getAddCheckConstraintSql(string cname, string src, *hash copt, *hash<auto> opt);
1284 
1285 
1286 protected:
1287  AbstractCheckConstraint addCheckConstraintUnlocked(string cname, string src, *hash<auto> opt, *reference<string> sql);
1288 public:
1289 
1290 
1291 protected:
1292  AbstractCheckConstraint addCheckConstraintUnlockedIntern(string cname, string src, *hash<auto> opt, *reference<string> sql);
1293 public:
1294 
1295 
1297 
1309  AbstractConstraint renameConstraint(string old_name, string new_name, reference lsql);
1310 
1311 
1313 
1332  string getDropConstraintSql(string cname, *hash<auto> opt);
1333 
1334 
1336 
1355  *string getDropConstraintIfExistsSql(string cname, *hash<auto> opt, *reference<AbstractConstraint> cref);
1356 
1357 
1358 protected:
1359  AbstractConstraint findDropConstraintUnlocked(string cname, reference<code> rmv);
1360 public:
1361 
1362 
1364 
1382  AbstractConstraint dropConstraint(string cname, *reference<string> sql);
1383 
1384 
1386 
1406  AbstractTrigger addTrigger(string tname, string src, *hash<auto> opt, *reference lsql);
1407 
1408 
1410 
1432  list<auto> getAddTriggerSql(string tname, string src, *hash topt, *hash<auto> opt);
1433 
1434 
1435 protected:
1436  AbstractTrigger addTriggerUnlocked(string tname, string src, *hash<auto> opt, *reference lsql);
1437 public:
1438 
1439 
1440 protected:
1441  AbstractTrigger addTriggerUnlockedIntern(string tname, string src, *hash<auto> opt, *reference lsql);
1442 public:
1443 
1444 
1446 
1464  AbstractTrigger dropTrigger(string tname, *reference<string> sql);
1465 
1466 
1468 
1487  list<auto> getDropTriggerSql(string tname, *hash<auto> opt);
1488 
1489 
1490 protected:
1491  getAllConstraintsUnlocked(*hash<auto> opt);
1492 public:
1493 
1494 
1495 protected:
1496  checkUniqueConstraintName(string err, string cname);
1497 public:
1498 
1499 
1500 protected:
1501  checkUniqueConstraintNameValidateOptions(string err, string cname, hash ropt, reference<hash> opt);
1502 public:
1503 
1504 
1506 protected:
1507  validateColumnOptions(string cname, reference<hash> opt, bool nullable);
1508 public:
1509 
1510 
1512 
1530  AbstractColumn dropColumn(string cname, *reference lsql);
1531 
1532 
1534 
1553  list<auto> getDropColumnSql(string cname, *hash<auto> opt);
1554 
1555 
1557 
1568  *hash<auto> insertCommit(hash<auto> row);
1569 
1570 
1572 
1576  *hash<auto> insertCommit(hash<auto> row, reference<string> sql);
1577 
1578 
1580 
1584  *hash<auto> insertCommit(hash<auto> row, hash<auto> opt);
1585 
1586 
1588 
1593  *hash<auto> insertCommit(hash<auto> row, reference<string> sql, hash<auto> opt);
1594 
1595 
1597 
1609  *hash<auto> insert(hash<auto> row);
1610 
1611 
1613 
1617  *hash<auto> insert(hash<auto> row, reference<string> sql);
1618 
1619 
1621 
1625  *hash<auto> insert(hash<auto> row, hash<auto> opt);
1626 
1627 
1629 
1634  *hash<auto> insert(hash<auto> row, reference<string> sql, hash<auto> opt);
1635 
1636 
1638 
1647  hash<SqlResultInfo> insertWithInfo(hash<auto> row, *hash<auto> opt);
1648 
1649 
1651  deprecated *hash<auto> insertNoCommit(hash<auto> row, *reference<string> sql, *hash<auto> opt);
1652 
1654  deprecated *hash<auto> insertNoCommit(hash<auto> row, hash<auto> opt);
1655 
1656 protected:
1657  *hash<auto> insertIntern(hash<auto> row, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
1658 public:
1659 
1660 
1661 protected:
1662  hash<auto> getPlaceholdersAndValues(hash<auto> row);
1663 public:
1664 
1665 
1667 
1671 
1672 
1674 
1693  int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh, reference<string> sql, hash<auto> opt);
1694 
1695 
1698 
1699 
1701  int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh);
1702 
1703 
1705  int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh, reference<string> sql);
1706 
1707 
1709  int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh, hash<auto> opt);
1710 
1711 
1713 
1732  int insertFromSelect(list cols, AbstractTable source, hash<auto> sh, reference<string> sql, hash<auto> opt);
1733 
1734 
1737 
1738 
1740  int insertFromSelect(list cols, AbstractTable source, hash<auto> sh);
1741 
1742 
1744  int insertFromSelect(list cols, AbstractTable source, hash<auto> sh, reference<string> sql);
1745 
1746 
1748  int insertFromSelect(list cols, AbstractTable source, hash<auto> sh, hash<auto> opt);
1749 
1750 
1752 
1765 hash<SqlResultInfo> insertFromSelectWithInfo(list<auto> cols, AbstractTable source, hash<auto> select_hash, *hash<auto> opt);
1766 
1767 
1769  deprecated int insertFromSelectNoCommit(list cols, AbstractTable source, *hash<auto> sh, *reference<string> sql, *hash<auto> opt);
1770 
1771 protected:
1772  int insertFromSelectIntern(list cols, AbstractTable source, *hash<auto> sh, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
1773 public:
1774 
1775 
1777 
1796 
1797 
1799 
1818 
1819 
1821  deprecated int insertFromIteratorNoCommit(Qore::AbstractIterator i, *hash<auto> opt);
1822 
1823 protected:
1824  int insertFromIteratorIntern(Qore::AbstractIterator i, *hash<auto> opt);
1825 public:
1826 
1827 
1829 
1845  int upsertCommit(hash<auto> row, int upsert_strategy = UpsertAuto, *hash<auto> opt);
1846 
1847 
1849 
1865  int upsert(hash<auto> row, int upsert_strategy = UpsertAuto, *hash<auto> opt);
1866 
1867 
1869  deprecated int upsertNoCommit(hash<auto> row, int upsert_strategy = UpsertAuto);
1870 
1872 
1893  code getUpsertClosure(hash<auto> row, int upsert_strategy = UpsertAuto, *hash<auto> opt);
1894 
1895 
1897 
1924  code getBulkUpsertClosure(hash example_row, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
1925 
1926 
1928 
1949  code getUpsertClosureWithValidation(hash example_row, int upsert_strategy = UpsertAuto, *hash<auto> opt);
1950 
1951 
1953 
1986 
1987 
1989 
2021  *hash upsertFromIterator(Qore::AbstractIterator i, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2022 
2023 
2025  deprecated *hash upsertFromIteratorNoCommit(Qore::AbstractIterator i, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2026 
2027 protected:
2028  *hash upsertFromIteratorIntern(Qore::AbstractIterator i, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2029 public:
2030 
2031 
2032 protected:
2033  *hash<auto> doDeleteOthersIntern(hash pkh, *hash<auto> opt);
2034 public:
2035 
2036 
2038 
2076  *hash upsertFromSelectCommit(AbstractTable t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2077 
2078 
2080  *hash upsertFromSelectCommit(Table t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2081 
2082 
2084 
2124  *hash upsertFromSelect(AbstractTable t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2125 
2126 
2128  deprecated *hash upsertFromSelectNoCommit(AbstractTable t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2129 
2131  deprecated *hash upsertFromSelect(Table t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2132 
2134  deprecated *hash upsertFromSelectNoCommit(Table t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2135 
2137 
2148  softint rowCount();
2149 
2150 
2152 
2173  Qore::SQL::SQLStatement getRowIterator(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2174 
2175 
2177 
2200  Qore::SQL::SQLStatement getRowIteratorNoExec(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2201 
2202 
2204 
2224  Qore::SQL::SQLStatement getRowIterator(*hash<auto> sh, *hash<auto> opt);
2225 
2226 
2228 
2250  Qore::SQL::AbstractSQLStatement getStatement(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2251 
2252 
2254 
2275  Qore::SQL::AbstractSQLStatement getStatement(*hash<auto> sh, *hash<auto> opt);
2276 
2277 
2279 
2311  hash<SqlResultInfo> getStatementWithInfo(*hash<auto> select_hash, *hash<auto> opt);
2312 
2313 
2315 
2337  Qore::SQL::AbstractSQLStatement getStatementNoExec(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2338 
2339 
2341 
2369  hash<SqlResultInfo> getStatementNoExecWithInfo(*hash<auto> select_hash, *hash<auto> opt);
2370 
2371 
2373 
2394  Qore::SQL::AbstractSQLStatement getStatementNoExec(*hash<auto> sh, *hash<auto> opt);
2395 
2396 
2397 protected:
2398  Qore::SQL::AbstractSQLStatement getStatementIntern(*hash<auto> sh, *reference<string> sql, *hash<auto> opt, *bool no_exec, *reference<softlist<auto>> args);
2399 public:
2400 
2401 
2403 
2422  *hash<auto> selectRow(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2423 
2424 
2425 protected:
2426  *hash<auto> selectRowIntern(*hash<auto> sh, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
2427 public:
2428 
2429 
2431 
2457  hash<SqlResultInfo> selectRowWithInfo(*hash<auto> select_hash, *hash<auto> opt);
2458 
2459 
2461 
2481  *list<auto> selectRows(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2482 
2483 
2484 protected:
2485  *list<auto> selectRowsIntern(*hash<auto> sh, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
2486 public:
2487 
2488 
2490 
2515  hash<SqlResultInfo> selectRowsWithInfo(*hash<auto> select_hash, *hash<auto> opt);
2516 
2517 
2519 
2538  *hash<auto> select(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2539 
2540 
2541 protected:
2542  *hash<auto> selectIntern(*hash<auto> sh, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
2543 public:
2544 
2545 
2547 
2572  hash<SqlResultInfo> selectWithInfo(*hash<auto> select_hash, *hash<auto> opt);
2573 
2574 
2576 
2594  *hash<auto> selectRow(*hash<auto> sh, *hash<auto> opt);
2595 
2596 
2598 
2615  *list selectRows(*hash<auto> sh, *hash<auto> opt);
2616 
2617 
2619 
2636  *hash<auto> select(*hash<auto> sh, *hash<auto> opt);
2637 
2638 
2640 
2658  string getSelectSql(*hash<auto> sh, *reference<list<auto>> args);
2659 
2660 
2661  *AbstractUniqueConstraint matchAnyUnique(list cols);
2662 
2663 
2664  string getSelectSqlIntern(*hash<auto> qh, reference<list<auto>> args, *hash<auto> opt);
2665 
2666 
2667  string getSelectSqlUnlocked(*hash<auto> qh, reference<list<auto>> args, *hash<auto> opt);
2668 
2669 
2670  // column & table information must be retrieved before calling this function
2671  string getSelectSqlUnlockedIntern(*hash<auto> qh, string from, reference<list<auto>> args, *hash<auto> ch, *hash<auto> opt);
2672 
2673 
2675  AbstractTable getSubtableFromString(string table, *hash<auto> opt);
2676 
2677 
2678 protected:
2679  string getFromIntern(string from, *hash<auto> qh);
2680 public:
2681 
2682 
2683 protected:
2684  list<auto> getGroupByListUnlocked(hash<auto> qh, *hash<auto> jch, *hash<auto> ch, *hash<auto> psch, list coll);
2685 public:
2686 
2687 
2688 protected:
2689  list<auto> getOrderByListUnlocked(hash<auto> qh, *hash<auto> jch, *hash<auto> ch, *hash<auto> psch, list coll);
2690 public:
2691 
2692 
2693 protected:
2694  list<auto> getGroupOrderByListUnlocked(string key, hash<auto> qh, *hash<auto> jch, *hash<auto> ch, *hash<auto> psch, list coll);
2695 public:
2696 
2697 
2698 protected:
2699  doForUpdate(reference<string> sql);
2700 public:
2701 
2702 
2703 protected:
2704  string getSelectSqlName(*hash<auto> qh);
2705 public:
2706 
2707 
2708 protected:
2709  string getColumnExpressionIntern(auto cvc, *hash<auto> jch, bool join, *hash<auto> ch, *hash<auto> psch);
2710 public:
2711 
2712 
2713 protected:
2714  string doColumnOperatorIntern(hash cvc, *hash<auto> jch, bool join, *hash<auto> ch, *hash<auto> psch, *reference psch_ref);
2715 public:
2716 
2717 
2718 protected:
2719  string doColumnOperatorIntern(auto cop, auto arg, *string cve, hash cm, *hash<auto> jch, bool join, *hash<auto> ch, *hash<auto> psch, *reference psch_ref);
2720 public:
2721 
2722 
2723 protected:
2724  string getColumnNameIntern(string cv, *hash<auto> jch, bool join, *hash<auto> ch, *hash<auto> psch);
2725 public:
2726 
2727 
2729 protected:
2731 public:
2732 
2733 
2734 protected:
2735  getSelectWhereSqlUnlocked(reference<string> sql, reference<list<auto>> args, *hash<auto> qh, *hash<auto> jch, bool join = False, *hash<auto> ch, *hash<auto> psch);
2736 public:
2737 
2738 
2739 protected:
2740  *string getWhereClause(*hash cond, reference<list<auto>> args, *string cprefix, *hash<auto> jch, bool join = False);
2741 public:
2742 
2743 
2744 protected:
2745  *string getWhereClause(list cond, reference<list<auto>> args, *string cprefix, *hash<auto> jch, bool join = False);
2746 public:
2747 
2748 
2749 protected:
2750  *string getWhereClauseUnlocked(list cond, reference<list<auto>> args, *string cprefix, *hash<auto> jch, bool join = False, *hash pch, *hash<auto> psch);
2751 public:
2752 
2753 
2754 protected:
2755  *string getWhereClauseUnlocked(*hash cond, reference<list<auto>> args, *string cprefix, *hash<auto> jch, bool join = False, *hash pch, *hash<auto> psch);
2756 public:
2757 
2758 
2759 protected:
2760  *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);
2761 public:
2762 
2763 
2764 protected:
2765  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);
2766 public:
2767 
2768 
2769  string getOrClause(list<auto> arglist, reference<list<auto>> args, *hash<auto> jch, bool join = False, *hash<auto> ch, *hash<auto> psch);
2770 
2771 
2772  string getOrClause(hash<auto> arg, reference<list<auto>> args, *hash<auto> jch, bool join = False, *hash<auto> ch, *hash<auto> psch);
2773 
2774 
2775 protected:
2776  doSelectOrderBySqlUnlocked(reference<string> sql, reference<list<auto>> args, *hash<auto> qh, *hash<auto> jch, *hash<auto> ch, *hash<auto> psch, list coll);
2777 public:
2778 
2779 
2781 
2796  int delCommit(hash cond, reference<string> sql, hash<auto> opt);
2797 
2798 
2800  int delCommit(hash cond, hash<auto> opt);
2801 
2802 
2804  int delCommit(hash cond, reference<string> sql);
2805 
2806 
2808  int delCommit(hash cond);
2809 
2810 
2812  int delCommit();
2813 
2814 
2816 
2831  int del(hash cond, reference<string> sql, hash<auto> opt);
2832 
2833 
2835  int del(hash cond, hash<auto> opt);
2836 
2837 
2839  int del(hash cond, reference<string> sql);
2840 
2841 
2843  int del(hash cond);
2844 
2845 
2847  int del();
2848 
2849 
2851 
2865  hash<SqlResultInfo> delWithInfo(hash<auto> cond, *hash<auto> opt);
2866 
2867 
2869  deprecated int delNoCommit(*hash cond, *reference<string> sql);
2870 
2871 protected:
2872  int delIntern(*hash<auto> cond, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
2873 public:
2874 
2875 
2877 
2894  int updateCommit(hash set, hash cond, reference<string> sql, hash<auto> opt);
2895 
2896 
2898  int updateCommit(hash set, hash cond, reference<string> sql);
2899 
2900 
2902  int updateCommit(hash set, hash cond, hash<auto> opt);
2903 
2904 
2906  int updateCommit(hash set, hash cond);
2907 
2908 
2910  int updateCommit(hash set);
2911 
2912 
2914 
2931  int update(hash set, hash cond, reference<string> sql, hash<auto> opt);
2932 
2933 
2935  int update(hash set, hash cond, reference<string> sql);
2936 
2937 
2939  int update(hash set, hash cond, hash<auto> opt);
2940 
2941 
2943  int update(hash set, hash cond);
2944 
2945 
2947  int update(hash set);
2948 
2949 
2951 
2969  hash<SqlResultInfo> updateWithInfo(hash<auto> set, hash<auto> cond, *hash<auto> opt);
2970 
2971 
2973 
2985  hash<SqlCommandInfo> getUpdateSql(hash<auto> set, *hash<auto> cond);
2986 
2987 
2989  deprecated int updateNoCommit(hash set, *hash cond, *reference<string> sql);
2990 
2992  deprecated int updateNoCommit(hash set, *hash cond, *hash<auto> opt);
2993 
2994 protected:
2995  int updateIntern(hash<auto> set, *hash<auto> cond, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
2996 public:
2997 
2998 
2999 protected:
3000  string getUpdateExpression(string col, hash<UpdateOperatorInfo> uh);
3001 public:
3002 
3003 
3004 protected:
3005  bool emptyDataIntern();
3006 public:
3007 
3008 
3009 protected:
3010  Columns checkUpsertRow(hash<auto> row, reference<int> upsert_strategy);
3011 public:
3012 
3013 
3014 protected:
3015  code getUpsertInsertFirst(Columns cols, hash example_row, *hash<auto> opt);
3016 public:
3017 
3018 
3019 protected:
3020  code getUpsertUpdateFirst(Columns cols, hash example_row, *hash<auto> opt);
3021 public:
3022 
3023 
3024 protected:
3025  code getUpsertSelectFirst(Columns cols, hash example_row, *hash<auto> opt);
3026 public:
3027 
3028 
3029 protected:
3030  code getUpsertInsertOnly(Columns cols, hash example_row, *hash<auto> opt);
3031 public:
3032 
3033 
3034 protected:
3035  code getUpsertUpdateOnly(Columns cols, hash example_row, *hash<auto> opt);
3036 public:
3037 
3038 
3039 protected:
3040  Columns getUpsertColumns(reference<string> csrc);
3041 public:
3042 
3043 
3045 
3053 protected:
3054  hash<string, Columns> getAllUpsertColumns(*hash<auto> row);
3055 public:
3056 
3057 
3058 protected:
3059  bool matchUniqueColumns(Columns cols, hash<auto> row);
3060 public:
3061 
3062 
3063 protected:
3064  string getUpsertSelectSql(hash<auto> row, Columns cols, reference<list<string>> updc);
3065 public:
3066 
3067 
3068 protected:
3069  string getUpsertInsertSql(hash<auto> row);
3070 public:
3071 
3072 
3073 protected:
3074  string getUpsertUpdateSql(hash<auto> row, Columns cols, reference updc, *hash<auto> opt);
3075 public:
3076 
3077 
3078 protected:
3079  softbool tryUpdate(string sql, hash<auto> row, Columns cols, list updc);
3080 public:
3081 
3082 
3083 protected:
3084  checkValue(string cname, string argname, reference val, string type);
3085 public:
3086 
3087 
3089 
3098  string getSqlFromList(list<auto> l);
3099 
3100 
3102 
3113  string getSqlValue(auto v);
3114 
3115 
3117  string getName();
3118 
3119 
3121 
3128  cache(*hash<auto> opts);
3129 
3130 
3132 
3138 
3139 
3141 
3149 
3150 
3152 
3161 
3162 
3164 
3174 
3175 
3176  *AbstractUniqueConstraint findUniqueConstraintUnlocked(string name);
3177 
3178 
3180 
3190 
3191 
3194 
3195 
3198 
3199 
3201 
3211 
3212 
3214 
3236  string getRenameSql(string new_name, *hash<auto> opt);
3237 
3238 
3240 
3249  string getCreateSqlString(*hash<auto> opt);
3250 
3251 
3253 
3262  list<auto> getCreateSql(*hash<auto> opt);
3263 
3264 
3266 
3277  string getCreateTableSql(*hash<auto> opt);
3278 
3279 
3281 
3286 
3287 
3288 protected:
3289  *hash<string, bool> getCheckOmissionOptions(*softlist<softstring> ol, string err);
3290 public:
3291 
3292 
3294 
3309  list<auto> getAlignSql(AbstractTable t, *hash<auto> opt);
3310 
3311 
3312 protected:
3313  list<auto> getAlignSqlUnlocked(AbstractTable t, *hash<auto> opt);
3314 public:
3315 
3316 
3317 protected:
3318  *AbstractColumnSupportingConstraint getSupportingConstraint(string ixname);
3319 public:
3320 
3321 
3322 protected:
3323  *list<AbstractColumnConstraint> getAllSupportingConstraints(string ixname);
3324 public:
3325 
3326 
3327 protected:
3328  renameIndexUnlocked(AbstractIndex ix, string new_name);
3329 public:
3330 
3331 
3333 
3346  string getAlignSqlString(AbstractTable t, *hash<auto> opt);
3347 
3348 
3350 
3362  *list<auto> getCreateIndexesSql(*hash<auto> opt, bool cache = True);
3363 
3364 
3366 
3378  *string getCreatePrimaryKeySql(*hash<auto> opt, bool cache = True);
3379 
3380 
3382 
3394  *list<auto> getCreateForeignConstraintsSql(*hash<auto> opt, bool cache = True);
3395 
3396 
3398 
3412  *list<auto> getCreateConstraintsSql(*hash<auto> opt, bool cache = True);
3413 
3414 
3416 
3428  *list<auto> getCreateMiscSql(*hash<auto> opt, bool cache = True);
3429 
3430 
3432 
3446  *list<auto> getCreateTriggersSql(*hash<auto> opt, bool cache = True);
3447 
3448 
3450 
3457  *hash find(auto id);
3458 
3459 
3461 
3472  *list find(list<auto> ids);
3473 
3474 
3475 protected:
3476  string getPrimaryKeyColumn();
3477 public:
3478 
3479 
3481 
3494  *hash<auto> find(hash<auto> row);
3495 
3496 
3498 
3511  *hash<auto> findSingle(*hash<auto> cond);
3512 
3513 
3515 
3528  *list<auto> findAll(*hash<auto> cond);
3529 
3530 
3532 
3536  string getDesc();
3537 
3538 
3540  string getBaseType();
3541 
3542 
3544  string getSqlName();
3545 
3546 
3548  string getColumnSqlName(string col);
3549 
3550 
3552  list<auto> getColumnSqlNames(softlist cols);
3553 
3554 
3556 
3559 
3560 
3562 
3566  *hash<string, AbstractDataField> getRecordType();
3567 
3568 
3570 
3579  AbstractDataField getColumnDataField(string column_name, *hash<auto> options, *string append_desc);
3580 
3581 
3583 
3591  AbstractDataField getColumnDataField(AbstractColumn column, *hash<SqlUtilDataTypeOptionInfo> options, *string append_desc);
3592 
3593 
3595 
3603  AbstractDataProviderType getColumnDataType(string column_name, *hash<SqlUtilDataTypeOptionInfo> options);
3604 
3605 
3607 
3609  AbstractDataProviderType getDbType(string native_type, *string qore_type, bool nullable, int max_size = -1, *hash<SqlUtilDataTypeOptionInfo> options);
3610 
3611 
3613 
3615  AbstractDataProviderType getNumericType(string type_name, bool nullable, *hash<auto> options);
3616 
3617 
3619 
3624 
3625 
3627  abstract bool hasArrayBind();
3628 
3630 
3632 protected:
3633  hash<auto> getTableOptions();
3634 public:
3635 
3636 
3638 
3640 protected:
3642 public:
3643 
3644 
3646 
3648 protected:
3649  hash<auto> getConstraintOptions();
3650 public:
3651 
3652 
3654 
3656 protected:
3657  hash<auto> getCacheOptions();
3658 public:
3659 
3660 
3662 
3664 protected:
3666 public:
3667 
3668 
3670 
3672 protected:
3673  hash<auto> getAlignTableOptions();
3674 public:
3675 
3676 
3678 
3680 protected:
3682 public:
3683 
3684 
3686 
3688 protected:
3689  hash<auto> getColumnOptions();
3690 public:
3691 
3692 
3694 
3696 protected:
3697  hash<auto> getColumnDescOptions();
3698 public:
3699 
3700 
3702 
3704 protected:
3706 public:
3707 
3708 
3710 
3712 protected:
3713  hash<auto> getIndexOptions();
3714 public:
3715 
3716 
3718 
3720 protected:
3721  hash<auto> getTriggerOptions();
3722 public:
3723 
3724 
3726 
3728 protected:
3729  hash<auto> getSelectOptions();
3730 public:
3731 
3732 
3734 
3736 protected:
3737  hash<auto> getUpsertOptions();
3738 public:
3739 
3740 
3742 
3744 protected:
3745  hash<auto> getInsertOptions();
3746 public:
3747 
3748 
3750 
3752 protected:
3754 public:
3755 
3756 
3758 
3760 protected:
3762 public:
3763 
3764 
3766 
3768 protected:
3769  hash<auto> getWhereOperatorMap();
3770 public:
3771 
3772 
3774 
3776 protected:
3777  hash<auto> getColumnOperatorMap();
3778 public:
3779 
3780 
3782 protected:
3784 public:
3785 
3786 
3788 
3824  addCustomCopOperator(string name, hash<auto> operator);
3825 
3826 
3828 
3830  bool isDuplicateRowError(hash<ExceptionInfo> ex);
3831 
3832 
3834 
3836 protected:
3837  hash<auto> getInsertOperatorMap();
3838 public:
3839 
3840 
3842 
3844 protected:
3845  hash<auto> getUpdateOperatorMap();
3846 public:
3847 
3848 
3850 
3852 protected:
3854 public:
3855 
3856 
3858 
3860 protected:
3861  *hash<auto> getPseudoColumnHash();
3862 public:
3863 
3864 
3865 protected:
3866  string getCreateTableSqlUnlocked(*hash<auto> opt);
3867 public:
3868 
3869 
3870 protected:
3871  *list<auto> getCreateIndexesSqlUnlocked(*hash<auto> opt, bool cache = True);
3872 public:
3873 
3874 
3875 protected:
3876  *string getCreatePrimaryKeySqlUnlocked(*hash<auto> opt, bool cache = True);
3877 public:
3878 
3879 
3880 protected:
3881  *list<auto> getCreateConstraintsSqlUnlocked(*hash<auto> opt, bool cache = True);
3882 public:
3883 
3884 
3885 protected:
3886  *list<auto> getCreateForeignConstraintsSqlUnlocked(*hash<auto> opt, bool cache = True);
3887 public:
3888 
3889 
3890 protected:
3891  *list<auto> getCreateMiscSqlUnlocked(*hash<auto> opt, bool cache = True);
3892 public:
3893 
3894 
3895 protected:
3896  *list<auto> getCreateTriggersSqlUnlocked(*hash<auto> opt, bool cache = True);
3897 public:
3898 
3899 
3900 protected:
3901  list<auto> getCreateSqlUnlocked(*hash<auto> opt, bool cache = True);
3902 public:
3903 
3904 
3905 protected:
3906  cacheUnlocked(*hash<auto> opt);
3907 public:
3908 
3909 
3910 protected:
3911  auto execData(*hash<auto> opt, string sql, *list<auto> args);
3912 public:
3913 
3914 
3915 protected:
3916  execData(AbstractSQLStatement stmt, *hash<auto> opt, *list<auto> args);
3917 public:
3918 
3919 
3920  static AbstractTable getTable(AbstractDatasource nds, string nname, *hash<auto> opts);
3921 
3922  static AbstractTable getTable(string dsstr, string nname, *hash<auto> opts);
3923 
3924  static AbstractTable getTable(hash<auto> dsh, string nname, *hash<auto> opts);
3925 
3926 protected:
3927  getColumnsUnlocked();
3928 public:
3929 
3930 
3931 protected:
3932  getPrimaryKeyUnlocked();
3933 public:
3934 
3935 
3936  // also loads primary key and constraints (for unique constraints)
3937 protected:
3938  getIndexesUnlocked();
3939 public:
3940 
3941 
3942 protected:
3943  getForeignConstraintsUnlocked(*hash<auto> opt);
3944 public:
3945 
3946 
3947 protected:
3948  addSourceConstraint(string table_name, AbstractForeignConstraint fk);
3949 public:
3950 
3951 
3952 protected:
3953  getConstraintsUnlocked();
3954 public:
3955 
3956 
3957 protected:
3958  getTriggersUnlocked();
3959 public:
3960 
3961 
3963 protected:
3965 public:
3966 
3967 
3968 protected:
3969  softlist<auto> getDropSqlImpl();
3970 public:
3971 
3972 
3973 protected:
3974  string getTruncateSqlImpl();
3975 public:
3976 
3977 
3979 protected:
3980  auto tryExecArgsImpl(string sql, *softlist<auto> args);
3981 public:
3982 
3983 
3985 protected:
3986  auto tryExecRawImpl(string sql);
3987 public:
3988 
3989 
3991 protected:
3993 public:
3994 
3995 
3996 protected:
3997  preSetupTableImpl(reference desc, *hash<auto> opt);
3998 public:
3999 
4000 
4002 
4004 protected:
4005  abstract AbstractDataProviderType getNumericTypeImpl(string type_name, bool nullable, *hash<auto> options);
4006 public:
4007 
4008 protected:
4009  abstract *hash<auto> doReturningImpl(hash<auto> opt, reference<string> sql, list<auto> args);
4010 public:
4011 
4012 protected:
4013  abstract bool emptyImpl();
4014 public:
4015 
4017 protected:
4018  abstract *string getSqlValueImpl(auto v);
4019 public:
4020 
4022 
4025 protected:
4026  abstract bool checkExistenceImpl();
4027 public:
4028 
4030 protected:
4031  abstract bool supportsTablespacesImpl();
4032 public:
4033 
4035 protected:
4037 public:
4038 
4040 protected:
4042 public:
4043 
4044 protected:
4045  abstract setupTableImpl(hash<auto> desc, *hash<auto> opt);
4046 public:
4047 
4048 protected:
4049  abstract Columns describeImpl();
4050 public:
4051 protected:
4052  abstract AbstractPrimaryKey getPrimaryKeyImpl();
4053 public:
4054 protected:
4055  abstract Indexes getIndexesImpl();
4056 public:
4057 protected:
4058  abstract ForeignConstraints getForeignConstraintsImpl(*hash<auto> opt);
4059 public:
4060 protected:
4061  abstract Constraints getConstraintsImpl();
4062 public:
4063 protected:
4064  abstract Triggers getTriggersImpl();
4065 public:
4066 
4067 protected:
4068  abstract string getCreateTableSqlImpl(*hash<auto> opt);
4069 public:
4070 protected:
4071  abstract *list<auto> getCreateMiscSqlImpl(*hash<auto> opt, bool cache);
4072 public:
4073 protected:
4074  abstract string getCreateSqlImpl(list<auto> l);
4075 public:
4076 protected:
4077  abstract string getRenameSqlImpl(string new_name);
4078 public:
4079 protected:
4080  abstract *list<auto> getAlignSqlImpl(AbstractTable t, *hash<auto> opt);
4081 public:
4082 
4083 protected:
4084  abstract AbstractColumn addColumnImpl(string cname, hash<auto> opt, bool nullable = True);
4085 public:
4086 protected:
4087  abstract AbstractPrimaryKey addPrimaryKeyImpl(string cname, hash<auto> ch, *hash<auto> opt);
4088 public:
4089 protected:
4090  abstract AbstractIndex addIndexImpl(string iname, bool enabled, hash<auto> ch, *hash<auto> opt);
4091 public:
4092 protected:
4093  abstract AbstractForeignConstraint addForeignConstraintImpl(string cname, hash<auto> ch, string table, hash<auto> tch, *hash<auto> opt);
4094 public:
4095 protected:
4096  abstract AbstractCheckConstraint addCheckConstraintImpl(string cname, string src, *hash<auto> opt);
4097 public:
4098 protected:
4099  abstract AbstractUniqueConstraint addUniqueConstraintImpl(string cname, hash<auto> ch, *hash<auto> opt);
4100 public:
4101 
4102 protected:
4103  abstract AbstractTrigger addTriggerImpl(string tname, string src, *hash<auto> opt);
4104 public:
4105 
4107 protected:
4108  abstract bool tryInsertImpl(string sql, hash<auto> row);
4109 public:
4110 
4112 protected:
4113  abstract hash<auto> getQoreTypeMapImpl();
4114 public:
4115 
4117 protected:
4118  abstract hash<auto> getTypeMapImpl();
4119 public:
4120 
4122 protected:
4123  abstract doSelectOrderByWithOffsetSqlUnlockedImpl(reference<string> sql, reference<list<auto>> args, *hash<auto> qh, *hash<auto> jch, *hash<auto> ch, *hash<auto> psch, list coll);
4124 public:
4125 
4127 protected:
4128  abstract doSelectLimitOnlyUnlockedImpl(reference<string> sql, reference<list<auto>> args, *hash<auto> qh);
4129 public:
4130 
4132 protected:
4133  abstract copyImpl(AbstractTable old);
4134 public:
4135 
4137 
4141 protected:
4143 public:
4144 
4146 
4148 protected:
4149  abstract bool isDuplicateRowErrorImpl(hash<ExceptionInfo> ex);
4150 public:
4151 };
4152 };
abstract class for check constraints
Definition: SqlUtil.qm.dox.h:5653
the base class for column information
Definition: SqlUtil.qm.dox.h:5286
the API for a constraint with columns
Definition: SqlUtil.qm.dox.h:5706
abstract base class for constraints
Definition: SqlUtil.qm.dox.h:5591
const CreationOptions
default generic creation options
Definition: AbstractDatabase.qc.dox.h:118
the base class for foreign key constraint information
Definition: SqlUtil.qm.dox.h:5866
the abstract base class for index information
Definition: SqlUtil.qm.dox.h:5461
represents a primary key
Definition: SqlUtil.qm.dox.h:5789
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:38
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:138
const UR_Updated
row was updated because it was different (only possible with UpsertSelectFirst)
Definition: AbstractTable.qc.dox.h:264
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:77
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; if the table is already known to be in the database in the database,...
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:208
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:243
*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:301
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:286
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:168
*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:231
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:200
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:127
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:261
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:307
hash< auto > getTableDescriptionHashOptions()
returns the table description hash<auto> options for this driver
string name
the table's name
Definition: AbstractTable.qc.dox.h:291
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:46
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:238
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:145
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:158
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:55
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:305
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:293
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:299
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:73
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:224
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:52
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:111
const UpsertStrategyDescriptionMap
hash mapping upsert strategy descriptions to upsert strategy codes
Definition: AbstractTable.qc.dox.h:249
clear()
purges the current table definition
hash< auto > getColumnOptions()
returns the column options for this driver
list< auto > getAlignSql(AbstractTable t, *hash< auto > opt)
accepts an AbstractTable argument and returns a list of SQL strings required to align the structure a...
const UpsertResultDescriptionMap
hash mapping upsert descriptions to codes
Definition: AbstractTable.qc.dox.h:282
*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()
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:217
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:84
const UR_Deleted
row was deleted (only possible with batch upsert methods such as AbstractTable::upsertFromIterator() ...
Definition: AbstractTable.qc.dox.h:270
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:303
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:295
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:68
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:96
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:276
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:309
*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:258
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:62
const AdditionalColumnDescOptions
additional column description keys valid when describing columns in a table description hash
Definition: AbstractTable.qc.dox.h:134
const InsertFromIteratorOptions
default insert option keys
Definition: AbstractTable.qc.dox.h:176
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:267
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:297
*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:6064
represents a unique column constraint
Definition: SqlUtil.qm.dox.h:5780
column container class that throws an exception if an unknown column is accessed
Definition: SqlUtil.qm.dox.h:5204
constraint container class that throws an exception if an unknown constraint is accessed
Definition: SqlUtil.qm.dox.h:5549
foreign constraint container class that throws an exception if an unknown constraint is accessed
Definition: SqlUtil.qm.dox.h:5800
index container class that throws an exception if an unknown index is accessed
Definition: SqlUtil.qm.dox.h:5415
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:5016
trigger container class that throws an exception if an unknown trigger is accessed
Definition: SqlUtil.qm.dox.h:6082
const True
const False
string join(string str,...)
hash< auto > hash(object obj)
string type(auto arg)
list< auto > list(...)
Qore AbstractDatabase class definition.
Definition: AbstractDatabase.qc.dox.h:26