Qore SqlUtil Module Reference  1.7.3
AbstractTable.qc.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
25 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 
194 
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 
257  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 
330  copy(AbstractTable old);
331 
332 
334 
345  setDatasource(AbstractDatasource nds);
346 
347 
348 protected:
349  doTableOptions(*hash<auto> nopts);
350 public:
351 
352 
354  commit();
355 
356 
358  rollback();
359 
360 
362 
371  bool inDb();
372 
373 
375 
383 
384 
386 
397  dropCommit(*hash<auto> opt);
398 
399 
401 
412  drop(*hash<auto> opt);
413 
414 
416  deprecated dropNoCommit(*hash<auto> opt);
417 
419 
430  auto tryExec(string sql);
431 
432 
434 
444  auto tryExecArgs(string sql, *softlist<auto> args);
445 
446 
448 
459  auto tryExecRaw(string sql);
460 
461 
463 
474  softlist<auto> getDropSql(*hash<auto> opt);
475 
476 
478 
485  truncateCommit();
486 
487 
489 
496  truncate();
497 
498 
500  deprecated truncateNoCommit();
501 
503 
518  string getTruncateSql(*hash<auto> opt);
519 
520 
522 
531  createCommit(*hash<auto> opt);
532 
533 
535 
546  create(*hash<auto> opt);
547 
548 
550  deprecated createNoCommit(*hash<auto> opt);
551 
553 
564  rename(string new_name, *reference<string> sql, *Tables table_cache);
565 
566 
567 protected:
568  doRenameIntern(string new_name, *Tables table_cache);
569 public:
570 
571 
573 
584  bool emptyData();
585 
586 
588 
597  bool empty();
598 
599 
600 protected:
601  bool emptyUnlocked();
602 public:
603 
604 
606 
612  setupTable(hash<auto> desc, *hash<auto> opt);
613 
614 
616 
640  AbstractColumn addColumn(string cname, hash<auto> opt, bool nullable = True, *reference lsql);
641 
642 
644 
673  list<auto> getAddColumnSql(string cname, hash copt, bool nullable = True, *hash<auto> opt);
674 
675 
676 protected:
677  AbstractColumn addColumnUnlocked(string cname, hash<auto> opt, bool nullable = True, *reference lsql, bool do_exec = True, bool modify_table = True);
678 public:
679 
680 
681 protected:
682  addColumnToTableUnlocked(AbstractColumn c);
683 public:
684 
685 
687 
712  AbstractColumn modifyColumn(string cname, hash<auto> opt, bool nullable = True, *reference lsql);
713 
714 
716 
743  list<auto> getModifyColumnSql(string cname, hash copt, bool nullable = True, *hash<auto> opt);
744 
745 
747 
764  AbstractColumn renameColumn(string old_name, string new_name, reference<string> sql);
765 
766 
768 
786  string getRenameColumnSql(string old_name, string new_name, *hash<auto> opt);
787 
788 
789 protected:
790  AbstractColumn renameColumnIntern(AbstractColumn c, string new_name);
791 public:
792 
793 
794 protected:
795  validateOptionsIntern(string err, hash ropt, reference<hash> opt);
796 public:
797 
798 
799 protected:
800  validateOptionsIntern(string err, hash ropt, reference<hash> opt, string tag);
801 public:
802 
803 
804 protected:
805  execSql(softlist lsql);
806 public:
807 
808 
810 
830  AbstractPrimaryKey addPrimaryKey(string pkname, softlist cols, *hash<auto> opt, *reference<string> sql);
831 
832 
834 
856  string getAddPrimaryKeySql(string pkname, softlist cols, *hash pkopt, *hash<auto> opt);
857 
858 
859 protected:
860  setPrimaryKeyUnlocked(AbstractPrimaryKey pk);
861 public:
862 
863 
864 protected:
865  AbstractPrimaryKey addPrimaryKeyUnlocked(string pkname, softlist cols, *hash<auto> opt, *reference<string> sql);
866 public:
867 
868 
869 protected:
870  AbstractPrimaryKey addPrimaryKeyUnlockedIntern(string pkname, softlist cols, *hash<auto> opt, *reference<string> sql);
871 public:
872 
873 
875 
891  list<auto> getDropAllConstraintsAndIndexesOnColumnSql(string cname, *hash<auto> opt);
892 
893 
894 protected:
895  list<auto> getDropAllConstraintsAndIndexesOnColumnSqlUnlocked(string cname, *hash<auto> opt);
896 public:
897 
898 
900 
919  list<auto> getDropPrimaryKeySql(*hash<auto> opt);
920 
921 
923 
941  AbstractPrimaryKey dropPrimaryKey(*reference lsql);
942 
943 
945 
966  AbstractUniqueConstraint addUniqueConstraint(string cname, softlist cols, *hash<auto> opt, *reference<string> sql);
967 
968 
970 
990  string getAddUniqueConstraintSql(string cname, softlist cols, *hash ukopt, *hash<auto> opt);
991 
992 
993 protected:
994  AbstractUniqueConstraint addUniqueConstraintUnlocked(string cname, softlist cols, *hash<auto> opt, *reference<string> sql);
995 public:
996 
997 
998 protected:
999  AbstractUniqueConstraint addUniqueConstraintUnlockedIntern(string cname, softlist cols, *hash<auto> opt, *reference<string> sql);
1000 public:
1001 
1002 
1004 
1025  AbstractIndex addIndex(string iname, bool unique, softlist cols, *hash<auto> opt, *reference<string> sql);
1026 
1027 
1029 
1050  string getAddIndexSql(string iname, bool unique, softlist cols, *hash<auto> ixopt, *hash<auto> opt);
1051 
1052 
1053 protected:
1054  AbstractIndex addIndexUnlocked(string iname, bool unique, softlist cols, *hash<auto> opt, *reference<string> sql);
1055 public:
1056 
1057 
1058 protected:
1059  AbstractIndex addIndexUnlockedIntern(string iname, bool unique, softlist cols, *hash<auto> opt, *reference<string> sql);
1060 public:
1061 
1062 
1064 
1076  AbstractIndex renameIndex(string old_name, string new_name, reference<string> sql);
1077 
1078 
1080 
1098  AbstractIndex dropIndex(string iname, *reference<string> sql);
1099 
1100 
1102 
1121  string getDropIndexSql(string iname, *hash<auto> opt);
1122 
1123 
1125 
1147  AbstractForeignConstraint addForeignConstraint(string cname, softlist cols, string table, *softlist tcols, *hash<auto> opt, *reference<string> sql);
1148 
1149 
1151 
1173  string getAddForeignConstraintSql(string cname, softlist cols, string table, *softlist tcols, *hash fkopt, *hash<auto> opt);
1174 
1175 
1176 protected:
1177  Columns getReferencedTableColumnsUnlocked(string table, *Tables cache, string err = 'FOREIGN-CONSTRAINT-ERROR');
1178 public:
1179 
1180 
1181 protected:
1182  AbstractForeignConstraint addForeignConstraintUnlocked(string cname, softlist cols, string table, *softlist tcols, *hash<auto> opt, *reference<string> sql);
1183 public:
1184 
1185 
1186 protected:
1187  AbstractForeignConstraint addForeignConstraintUnlockedIntern(string cname, softlist cols, string table, *softlist tcols, *hash<auto> opt, *reference<string> sql);
1188 public:
1189 
1190 
1192 
1210  AbstractForeignConstraint dropForeignConstraint(string cname, *reference<string> sql);
1211 
1212 
1214 
1230 
1231 
1233 
1253  AbstractCheckConstraint addCheckConstraint(string cname, string src, *hash<auto> opt, *reference<string> sql);
1254 
1255 
1257 
1279  string getAddCheckConstraintSql(string cname, string src, *hash copt, *hash<auto> opt);
1280 
1281 
1282 protected:
1283  AbstractCheckConstraint addCheckConstraintUnlocked(string cname, string src, *hash<auto> opt, *reference<string> sql);
1284 public:
1285 
1286 
1287 protected:
1288  AbstractCheckConstraint addCheckConstraintUnlockedIntern(string cname, string src, *hash<auto> opt, *reference<string> sql);
1289 public:
1290 
1291 
1293 
1305  AbstractConstraint renameConstraint(string old_name, string new_name, reference lsql);
1306 
1307 
1309 
1328  string getDropConstraintSql(string cname, *hash<auto> opt);
1329 
1330 
1332 
1351  *string getDropConstraintIfExistsSql(string cname, *hash<auto> opt, *reference<AbstractConstraint> cref);
1352 
1353 
1354 protected:
1355  AbstractConstraint findDropConstraintUnlocked(string cname, reference<code> rmv);
1356 public:
1357 
1358 
1360 
1378  AbstractConstraint dropConstraint(string cname, *reference<string> sql);
1379 
1380 
1382 
1402  AbstractTrigger addTrigger(string tname, string src, *hash<auto> opt, *reference lsql);
1403 
1404 
1406 
1428  list<auto> getAddTriggerSql(string tname, string src, *hash topt, *hash<auto> opt);
1429 
1430 
1431 protected:
1432  AbstractTrigger addTriggerUnlocked(string tname, string src, *hash<auto> opt, *reference lsql);
1433 public:
1434 
1435 
1436 protected:
1437  AbstractTrigger addTriggerUnlockedIntern(string tname, string src, *hash<auto> opt, *reference lsql);
1438 public:
1439 
1440 
1442 
1460  AbstractTrigger dropTrigger(string tname, *reference<string> sql);
1461 
1462 
1464 
1483  list<auto> getDropTriggerSql(string tname, *hash<auto> opt);
1484 
1485 
1486 protected:
1487  getAllConstraintsUnlocked(*hash<auto> opt);
1488 public:
1489 
1490 
1491 protected:
1492  checkUniqueConstraintName(string err, string cname);
1493 public:
1494 
1495 
1496 protected:
1497  checkUniqueConstraintNameValidateOptions(string err, string cname, hash ropt, reference<hash> opt);
1498 public:
1499 
1500 
1502 protected:
1503  validateColumnOptions(string cname, reference<hash> opt, bool nullable);
1504 public:
1505 
1506 
1508 
1526  AbstractColumn dropColumn(string cname, *reference lsql);
1527 
1528 
1530 
1549  list<auto> getDropColumnSql(string cname, *hash<auto> opt);
1550 
1551 
1553 
1564  *hash<auto> insertCommit(hash<auto> row);
1565 
1566 
1568 
1572  *hash<auto> insertCommit(hash<auto> row, reference<string> sql);
1573 
1574 
1576 
1580  *hash<auto> insertCommit(hash<auto> row, hash<auto> opt);
1581 
1582 
1584 
1589  *hash<auto> insertCommit(hash<auto> row, reference<string> sql, hash<auto> opt);
1590 
1591 
1593 
1605  *hash<auto> insert(hash<auto> row);
1606 
1607 
1609 
1613  *hash<auto> insert(hash<auto> row, reference<string> sql);
1614 
1615 
1617 
1621  *hash<auto> insert(hash<auto> row, hash<auto> opt);
1622 
1623 
1625 
1630  *hash<auto> insert(hash<auto> row, reference<string> sql, hash<auto> opt);
1631 
1632 
1634 
1643  hash<SqlResultInfo> insertWithInfo(hash<auto> row, *hash<auto> opt);
1644 
1645 
1647  deprecated *hash<auto> insertNoCommit(hash<auto> row, *reference<string> sql, *hash<auto> opt);
1648 
1650  deprecated *hash<auto> insertNoCommit(hash<auto> row, hash<auto> opt);
1651 
1652 protected:
1653  *hash<auto> insertIntern(hash<auto> row, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
1654 public:
1655 
1656 
1657 protected:
1658  hash<auto> getPlaceholdersAndValues(hash<auto> row);
1659 public:
1660 
1661 
1663 
1666  bool hasReturning();
1667 
1668 
1670 
1689  int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh, reference<string> sql, hash<auto> opt);
1690 
1691 
1693  int insertFromSelectCommit(list cols, AbstractTable source);
1694 
1695 
1697  int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh);
1698 
1699 
1701  int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh, reference<string> sql);
1702 
1703 
1705  int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh, hash<auto> opt);
1706 
1707 
1709 
1728  int insertFromSelect(list cols, AbstractTable source, hash<auto> sh, reference<string> sql, hash<auto> opt);
1729 
1730 
1732  int insertFromSelect(list cols, AbstractTable source);
1733 
1734 
1736  int insertFromSelect(list cols, AbstractTable source, hash<auto> sh);
1737 
1738 
1740  int insertFromSelect(list cols, AbstractTable source, hash<auto> sh, reference<string> sql);
1741 
1742 
1744  int insertFromSelect(list cols, AbstractTable source, hash<auto> sh, hash<auto> opt);
1745 
1746 
1748 
1761 hash<SqlResultInfo> insertFromSelectWithInfo(list<auto> cols, AbstractTable source, hash<auto> select_hash, *hash<auto> opt);
1762 
1763 
1765  deprecated int insertFromSelectNoCommit(list cols, AbstractTable source, *hash<auto> sh, *reference<string> sql, *hash<auto> opt);
1766 
1767 protected:
1768  int insertFromSelectIntern(list cols, AbstractTable source, *hash<auto> sh, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
1769 public:
1770 
1771 
1773 
1791  int insertFromIteratorCommit(Qore::AbstractIterator i, *hash<auto> opt);
1792 
1793 
1795 
1813  int insertFromIterator(Qore::AbstractIterator i, *hash<auto> opt);
1814 
1815 
1817  deprecated int insertFromIteratorNoCommit(Qore::AbstractIterator i, *hash<auto> opt);
1818 
1819 protected:
1820  int insertFromIteratorIntern(Qore::AbstractIterator i, *hash<auto> opt);
1821 public:
1822 
1823 
1825 
1841  int upsertCommit(hash<auto> row, int upsert_strategy = UpsertAuto, *hash<auto> opt);
1842 
1843 
1845 
1861  int upsert(hash<auto> row, int upsert_strategy = UpsertAuto, *hash<auto> opt);
1862 
1863 
1865  deprecated int upsertNoCommit(hash<auto> row, int upsert_strategy = UpsertAuto);
1866 
1868 
1889  code getUpsertClosure(hash<auto> row, int upsert_strategy = UpsertAuto, *hash<auto> opt);
1890 
1891 
1893 
1920  code getBulkUpsertClosure(hash example_row, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
1921 
1922 
1924 
1945  code getUpsertClosureWithValidation(hash example_row, int upsert_strategy = UpsertAuto, *hash<auto> opt);
1946 
1947 
1949 
1981  *hash upsertFromIteratorCommit(Qore::AbstractIterator i, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
1982 
1983 
1985 
2017  *hash upsertFromIterator(Qore::AbstractIterator i, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2018 
2019 
2021  deprecated *hash upsertFromIteratorNoCommit(Qore::AbstractIterator i, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2022 
2023 protected:
2024  *hash upsertFromIteratorIntern(Qore::AbstractIterator i, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2025 public:
2026 
2027 
2028 protected:
2029  *hash<auto> doDeleteOthersIntern(hash pkh, *hash<auto> opt);
2030 public:
2031 
2032 
2034 
2072  *hash upsertFromSelectCommit(AbstractTable t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2073 
2074 
2076  *hash upsertFromSelectCommit(Table t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2077 
2078 
2080 
2120  *hash upsertFromSelect(AbstractTable t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2121 
2122 
2124  deprecated *hash upsertFromSelectNoCommit(AbstractTable t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2125 
2127  deprecated *hash upsertFromSelect(Table t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2128 
2130  deprecated *hash upsertFromSelectNoCommit(Table t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2131 
2133 
2144  softint rowCount();
2145 
2146 
2148 
2169  Qore::SQL::SQLStatement getRowIterator(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2170 
2171 
2173 
2196  Qore::SQL::SQLStatement getRowIteratorNoExec(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2197 
2198 
2200 
2220  Qore::SQL::SQLStatement getRowIterator(*hash<auto> sh, *hash<auto> opt);
2221 
2222 
2224 
2246  Qore::SQL::AbstractSQLStatement getStatement(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2247 
2248 
2250 
2271  Qore::SQL::AbstractSQLStatement getStatement(*hash<auto> sh, *hash<auto> opt);
2272 
2273 
2275 
2307  hash<SqlResultInfo> getStatementWithInfo(*hash<auto> select_hash, *hash<auto> opt);
2308 
2309 
2311 
2333  Qore::SQL::AbstractSQLStatement getStatementNoExec(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2334 
2335 
2337 
2365  hash<SqlResultInfo> getStatementNoExecWithInfo(*hash<auto> select_hash, *hash<auto> opt);
2366 
2367 
2369 
2390  Qore::SQL::AbstractSQLStatement getStatementNoExec(*hash<auto> sh, *hash<auto> opt);
2391 
2392 
2393 protected:
2394  Qore::SQL::AbstractSQLStatement getStatementIntern(*hash<auto> sh, *reference<string> sql, *hash<auto> opt, *bool no_exec, *reference<softlist<auto>> args);
2395 public:
2396 
2397 
2399 
2418  *hash<auto> selectRow(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2419 
2420 
2421 protected:
2422  *hash<auto> selectRowIntern(*hash<auto> sh, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
2423 public:
2424 
2425 
2427 
2453  hash<SqlResultInfo> selectRowWithInfo(*hash<auto> select_hash, *hash<auto> opt);
2454 
2455 
2457 
2477  *list<auto> selectRows(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2478 
2479 
2480 protected:
2481  *list<auto> selectRowsIntern(*hash<auto> sh, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
2482 public:
2483 
2484 
2486 
2511  hash<SqlResultInfo> selectRowsWithInfo(*hash<auto> select_hash, *hash<auto> opt);
2512 
2513 
2515 
2534  *hash<auto> select(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2535 
2536 
2537 protected:
2538  *hash<auto> selectIntern(*hash<auto> sh, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
2539 public:
2540 
2541 
2543 
2568  hash<SqlResultInfo> selectWithInfo(*hash<auto> select_hash, *hash<auto> opt);
2569 
2570 
2572 
2590  *hash<auto> selectRow(*hash<auto> sh, *hash<auto> opt);
2591 
2592 
2594 
2611  *list selectRows(*hash<auto> sh, *hash<auto> opt);
2612 
2613 
2615 
2632  *hash<auto> select(*hash<auto> sh, *hash<auto> opt);
2633 
2634 
2636 
2654  string getSelectSql(*hash<auto> sh, *reference<list<auto>> args);
2655 
2656 
2657  *AbstractUniqueConstraint matchAnyUnique(list cols);
2658 
2659 
2660  string getSelectSqlIntern(*hash<auto> qh, reference<list<auto>> args, *hash<auto> opt);
2661 
2662 
2663  string getSelectSqlUnlocked(*hash<auto> qh, reference<list<auto>> args, *hash<auto> opt);
2664 
2665 
2666  // column & table information must be retrieved before calling this function
2667  string getSelectSqlUnlockedIntern(*hash<auto> qh, string from, reference<list<auto>> args, *hash<auto> ch, *hash<auto> opt);
2668 
2669 
2671  AbstractTable getSubtableFromString(string table, *hash<auto> opt);
2672 
2673 
2674 protected:
2675  string getFromIntern(string from, *hash<auto> qh);
2676 public:
2677 
2678 
2679 protected:
2680  list<auto> getGroupByListUnlocked(hash<auto> qh, *hash<auto> jch, *hash<auto> ch, *hash<auto> psch, list coll);
2681 public:
2682 
2683 
2684 protected:
2685  list<auto> getOrderByListUnlocked(hash<auto> qh, *hash<auto> jch, *hash<auto> ch, *hash<auto> psch, list coll);
2686 public:
2687 
2688 
2689 protected:
2690  list<auto> getGroupOrderByListUnlocked(string key, hash<auto> qh, *hash<auto> jch, *hash<auto> ch, *hash<auto> psch, list coll);
2691 public:
2692 
2693 
2694 protected:
2695  doForUpdate(reference<string> sql);
2696 public:
2697 
2698 
2699 protected:
2700  string getSelectSqlName(*hash<auto> qh);
2701 public:
2702 
2703 
2704 protected:
2705  string getColumnExpressionIntern(auto cvc, *hash<auto> jch, bool join, *hash<auto> ch, *hash<auto> psch);
2706 public:
2707 
2708 
2709 protected:
2710  string doColumnOperatorIntern(hash cvc, *hash<auto> jch, bool join, *hash<auto> ch, *hash<auto> psch, *reference psch_ref);
2711 public:
2712 
2713 
2714 protected:
2715  string doColumnOperatorIntern(auto cop, auto arg, *string cve, hash cm, *hash<auto> jch, bool join, *hash<auto> ch, *hash<auto> psch, *reference psch_ref);
2716 public:
2717 
2718 
2719 protected:
2720  string getColumnNameIntern(string cv, *hash<auto> jch, bool join, *hash<auto> ch, *hash<auto> psch);
2721 public:
2722 
2723 
2725 protected:
2726  bool asteriskRequiresPrefix();
2727 public:
2728 
2729 
2730 protected:
2731  getSelectWhereSqlUnlocked(reference<string> sql, reference<list<auto>> args, *hash<auto> qh, *hash<auto> jch, bool join = False, *hash<auto> ch, *hash<auto> psch);
2732 public:
2733 
2734 
2735 protected:
2736  *string getWhereClause(*hash cond, reference<list<auto>> args, *string cprefix, *hash<auto> jch, bool join = False);
2737 public:
2738 
2739 
2740 protected:
2741  *string getWhereClause(list cond, reference<list<auto>> args, *string cprefix, *hash<auto> jch, bool join = False);
2742 public:
2743 
2744 
2745 protected:
2746  *string getWhereClauseUnlocked(list cond, reference<list<auto>> args, *string cprefix, *hash<auto> jch, bool join = False, *hash pch, *hash<auto> psch);
2747 public:
2748 
2749 
2750 protected:
2751  *string getWhereClauseUnlocked(*hash cond, reference<list<auto>> args, *string cprefix, *hash<auto> jch, bool join = False, *hash pch, *hash<auto> psch);
2752 public:
2753 
2754 
2755 protected:
2756  *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);
2757 public:
2758 
2759 
2760 protected:
2761  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);
2762 public:
2763 
2764 
2765  string getOrClause(list<auto> arglist, reference<list<auto>> args, *hash<auto> jch, bool join = False, *hash<auto> ch, *hash<auto> psch);
2766 
2767 
2768  string getOrClause(hash<auto> arg, reference<list<auto>> args, *hash<auto> jch, bool join = False, *hash<auto> ch, *hash<auto> psch);
2769 
2770 
2771 protected:
2772  doSelectOrderBySqlUnlocked(reference<string> sql, reference<list<auto>> args, *hash<auto> qh, *hash<auto> jch, *hash<auto> ch, *hash<auto> psch, list coll);
2773 public:
2774 
2775 
2777 
2792  int delCommit(hash cond, reference<string> sql, hash<auto> opt);
2793 
2794 
2796  int delCommit(hash cond, hash<auto> opt);
2797 
2798 
2800  int delCommit(hash cond, reference<string> sql);
2801 
2802 
2804  int delCommit(hash cond);
2805 
2806 
2808  int delCommit();
2809 
2810 
2812 
2827  int del(hash cond, reference<string> sql, hash<auto> opt);
2828 
2829 
2831  int del(hash cond, hash<auto> opt);
2832 
2833 
2835  int del(hash cond, reference<string> sql);
2836 
2837 
2839  int del(hash cond);
2840 
2841 
2843  int del();
2844 
2845 
2847 
2861  hash<SqlResultInfo> delWithInfo(hash<auto> cond, *hash<auto> opt);
2862 
2863 
2865  deprecated int delNoCommit(*hash cond, *reference<string> sql);
2866 
2867 protected:
2868  int delIntern(*hash<auto> cond, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
2869 public:
2870 
2871 
2873 
2890  int updateCommit(hash set, hash cond, reference<string> sql, hash<auto> opt);
2891 
2892 
2894  int updateCommit(hash set, hash cond, reference<string> sql);
2895 
2896 
2898  int updateCommit(hash set, hash cond, hash<auto> opt);
2899 
2900 
2902  int updateCommit(hash set, hash cond);
2903 
2904 
2906  int updateCommit(hash set);
2907 
2908 
2910 
2927  int update(hash set, hash cond, reference<string> sql, hash<auto> opt);
2928 
2929 
2931  int update(hash set, hash cond, reference<string> sql);
2932 
2933 
2935  int update(hash set, hash cond, hash<auto> opt);
2936 
2937 
2939  int update(hash set, hash cond);
2940 
2941 
2943  int update(hash set);
2944 
2945 
2947 
2965  hash<SqlResultInfo> updateWithInfo(hash<auto> set, hash<auto> cond, *hash<auto> opt);
2966 
2967 
2969 
2981  hash<SqlCommandInfo> getUpdateSql(hash<auto> set, *hash<auto> cond);
2982 
2983 
2985  deprecated int updateNoCommit(hash set, *hash cond, *reference<string> sql);
2986 
2988  deprecated int updateNoCommit(hash set, *hash cond, *hash<auto> opt);
2989 
2990 protected:
2991  int updateIntern(hash<auto> set, *hash<auto> cond, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
2992 public:
2993 
2994 
2995 protected:
2996  string getUpdateExpression(string col, hash<UpdateOperatorInfo> uh);
2997 public:
2998 
2999 
3000 protected:
3001  bool emptyDataIntern();
3002 public:
3003 
3004 
3005 protected:
3006  Columns checkUpsertRow(hash<auto> row, reference<int> upsert_strategy);
3007 public:
3008 
3009 
3010 protected:
3011  code getUpsertInsertFirst(Columns cols, hash example_row, *hash<auto> opt);
3012 public:
3013 
3014 
3015 protected:
3016  code getUpsertUpdateFirst(Columns cols, hash example_row, *hash<auto> opt);
3017 public:
3018 
3019 
3020 protected:
3021  code getUpsertSelectFirst(Columns cols, hash example_row, *hash<auto> opt);
3022 public:
3023 
3024 
3025 protected:
3026  code getUpsertInsertOnly(Columns cols, hash example_row, *hash<auto> opt);
3027 public:
3028 
3029 
3030 protected:
3031  code getUpsertUpdateOnly(Columns cols, hash example_row, *hash<auto> opt);
3032 public:
3033 
3034 
3035 protected:
3036  Columns getUpsertColumns(reference<string> csrc);
3037 public:
3038 
3039 
3040 protected:
3041  string getUpsertSelectSql(hash<auto> row, Columns cols, reference<list<string>> updc);
3042 public:
3043 
3044 
3045 protected:
3046  string getUpsertInsertSql(hash<auto> row);
3047 public:
3048 
3049 
3050 protected:
3051  string getUpsertUpdateSql(hash<auto> row, Columns cols, reference updc, *hash<auto> opt);
3052 public:
3053 
3054 
3055 protected:
3056  softbool tryUpdate(string sql, hash<auto> row, Columns cols, list updc);
3057 public:
3058 
3059 
3060 protected:
3061  checkValue(string cname, string argname, reference val, string type);
3062 public:
3063 
3064 
3066 
3075  string getSqlFromList(list<auto> l);
3076 
3077 
3079 
3090  string getSqlValue(auto v);
3091 
3092 
3094  string getName();
3095 
3096 
3098 
3105  cache(*hash<auto> opts);
3106 
3107 
3109 
3114  clear();
3115 
3116 
3118 
3125  Columns describe();
3126 
3127 
3129 
3138 
3139 
3141 
3151 
3152 
3153  *AbstractUniqueConstraint findUniqueConstraintUnlocked(string name);
3154 
3155 
3157 
3166  Indexes getIndexes();
3167 
3168 
3170  ForeignConstraints getForeignConstraints(*hash<auto> opt);
3171 
3172 
3175 
3176 
3178 
3188 
3189 
3191 
3213  string getRenameSql(string new_name, *hash<auto> opt);
3214 
3215 
3217 
3226  string getCreateSqlString(*hash<auto> opt);
3227 
3228 
3230 
3239  list<auto> getCreateSql(*hash<auto> opt);
3240 
3241 
3243 
3254  string getCreateTableSql(*hash<auto> opt);
3255 
3256 
3258 
3262  bool checkExistence();
3263 
3264 
3265 protected:
3266  *hash<string, bool> getCheckOmissionOptions(*softlist<softstring> ol, string err);
3267 public:
3268 
3269 
3271 
3286  list<auto> getAlignSql(AbstractTable t, *hash<auto> opt);
3287 
3288 
3289 protected:
3290  list<auto> getAlignSqlUnlocked(AbstractTable t, *hash<auto> opt);
3291 public:
3292 
3293 
3294 protected:
3295  *AbstractColumnSupportingConstraint getSupportingConstraint(string ixname);
3296 public:
3297 
3298 
3299 protected:
3300  *list<AbstractColumnConstraint> getAllSupportingConstraints(string ixname);
3301 public:
3302 
3303 
3304 protected:
3305  renameIndexUnlocked(AbstractIndex ix, string new_name);
3306 public:
3307 
3308 
3310 
3323  string getAlignSqlString(AbstractTable t, *hash<auto> opt);
3324 
3325 
3327 
3339  *list<auto> getCreateIndexesSql(*hash<auto> opt, bool cache = True);
3340 
3341 
3343 
3355  *string getCreatePrimaryKeySql(*hash<auto> opt, bool cache = True);
3356 
3357 
3359 
3371  *list<auto> getCreateForeignConstraintsSql(*hash<auto> opt, bool cache = True);
3372 
3373 
3375 
3389  *list<auto> getCreateConstraintsSql(*hash<auto> opt, bool cache = True);
3390 
3391 
3393 
3405  *list<auto> getCreateMiscSql(*hash<auto> opt, bool cache = True);
3406 
3407 
3409 
3423  *list<auto> getCreateTriggersSql(*hash<auto> opt, bool cache = True);
3424 
3425 
3427 
3434  *hash find(auto id);
3435 
3436 
3438 
3449  *list find(list<auto> ids);
3450 
3451 
3452 protected:
3453  string getPrimaryKeyColumn();
3454 public:
3455 
3456 
3458 
3471  *hash<auto> find(hash<auto> row);
3472 
3473 
3475 
3488  *hash<auto> findSingle(*hash<auto> cond);
3489 
3490 
3492 
3505  *list<auto> findAll(*hash<auto> cond);
3506 
3507 
3509 
3513  string getDesc();
3514 
3515 
3517  string getBaseType();
3518 
3519 
3521  string getSqlName();
3522 
3523 
3525  string getColumnSqlName(string col);
3526 
3527 
3529  list<auto> getColumnSqlNames(softlist cols);
3530 
3531 
3533 
3535  bool bindEmptyStringsAsNull();
3536 
3537 
3539 
3543  *hash<string, AbstractDataField> getRecordType();
3544 
3545 
3547 
3556  AbstractDataField getColumnDataField(string column_name, *hash<auto> options, *string append_desc);
3557 
3558 
3560 
3568  AbstractDataField getColumnDataField(AbstractColumn column, *hash<SqlUtilDataTypeOptionInfo> options, *string append_desc);
3569 
3570 
3572 
3580  AbstractDataProviderType getColumnDataType(string column_name, *hash<SqlUtilDataTypeOptionInfo> options);
3581 
3582 
3584 
3586  AbstractDataProviderType getDbType(string native_type, *string qore_type, bool nullable, int max_size = -1, *hash<SqlUtilDataTypeOptionInfo> options);
3587 
3588 
3590 
3592  AbstractDataProviderType getNumericType(string type_name, bool nullable, *hash<auto> options);
3593 
3594 
3596 
3600  AbstractSavepointHelper getSavepointHelper(*string savepoint);
3601 
3602 
3604  abstract bool hasArrayBind();
3605 
3607 
3609 protected:
3610  hash<auto> getTableOptions();
3611 public:
3612 
3613 
3615 
3617 protected:
3618  hash<auto> getForeignConstraintOptions();
3619 public:
3620 
3621 
3623 
3625 protected:
3626  hash<auto> getConstraintOptions();
3627 public:
3628 
3629 
3631 
3633 protected:
3634  hash<auto> getCacheOptions();
3635 public:
3636 
3637 
3639 
3641 protected:
3642  hash<auto> getTableCreationOptions();
3643 public:
3644 
3645 
3647 
3649 protected:
3650  hash<auto> getAlignTableOptions();
3651 public:
3652 
3653 
3655 
3657 protected:
3658  hash<auto> getTableDescriptionHashOptions();
3659 public:
3660 
3661 
3663 
3665 protected:
3666  hash<auto> getColumnOptions();
3667 public:
3668 
3669 
3671 
3673 protected:
3674  hash<auto> getColumnDescOptions();
3675 public:
3676 
3677 
3679 
3681 protected:
3682  hash<auto> getTableColumnDescOptions();
3683 public:
3684 
3685 
3687 
3689 protected:
3690  hash<auto> getIndexOptions();
3691 public:
3692 
3693 
3695 
3697 protected:
3698  hash<auto> getTriggerOptions();
3699 public:
3700 
3701 
3703 
3705 protected:
3706  hash<auto> getSelectOptions();
3707 public:
3708 
3709 
3711 
3713 protected:
3714  hash<auto> getUpsertOptions();
3715 public:
3716 
3717 
3719 
3721 protected:
3722  hash<auto> getInsertOptions();
3723 public:
3724 
3725 
3727 
3729 protected:
3730  hash<auto> getInsertFromIteratorOptions();
3731 public:
3732 
3733 
3735 
3737 protected:
3738  hash<auto> getSqlDataCallbackOptions();
3739 public:
3740 
3741 
3743 
3745 protected:
3746  hash<auto> getWhereOperatorMap();
3747 public:
3748 
3749 
3751 
3753 protected:
3754  hash<auto> getColumnOperatorMap();
3755 public:
3756 
3757 
3759 protected:
3760  *hash<auto> getColumnOperatorMapImpl();
3761 public:
3762 
3763 
3765 
3801  addCustomCopOperator(string name, hash<auto> operator);
3802 
3803 
3805 
3807  bool isDuplicateRowError(hash<ExceptionInfo> ex);
3808 
3809 
3811 
3813 protected:
3814  hash<auto> getInsertOperatorMap();
3815 public:
3816 
3817 
3819 
3821 protected:
3822  hash<auto> getUpdateOperatorMap();
3823 public:
3824 
3825 
3827 
3829 protected:
3830  hash<auto> getRawUpdateOperatorMap();
3831 public:
3832 
3833 
3835 
3837 protected:
3838  *hash<auto> getPseudoColumnHash();
3839 public:
3840 
3841 
3842 protected:
3843  string getCreateTableSqlUnlocked(*hash<auto> opt);
3844 public:
3845 
3846 
3847 protected:
3848  *list<auto> getCreateIndexesSqlUnlocked(*hash<auto> opt, bool cache = True);
3849 public:
3850 
3851 
3852 protected:
3853  *string getCreatePrimaryKeySqlUnlocked(*hash<auto> opt, bool cache = True);
3854 public:
3855 
3856 
3857 protected:
3858  *list<auto> getCreateConstraintsSqlUnlocked(*hash<auto> opt, bool cache = True);
3859 public:
3860 
3861 
3862 protected:
3863  *list<auto> getCreateForeignConstraintsSqlUnlocked(*hash<auto> opt, bool cache = True);
3864 public:
3865 
3866 
3867 protected:
3868  *list<auto> getCreateMiscSqlUnlocked(*hash<auto> opt, bool cache = True);
3869 public:
3870 
3871 
3872 protected:
3873  *list<auto> getCreateTriggersSqlUnlocked(*hash<auto> opt, bool cache = True);
3874 public:
3875 
3876 
3877 protected:
3878  list<auto> getCreateSqlUnlocked(*hash<auto> opt, bool cache = True);
3879 public:
3880 
3881 
3882 protected:
3883  cacheUnlocked(*hash<auto> opt);
3884 public:
3885 
3886 
3887 protected:
3888  auto execData(*hash<auto> opt, string sql, *list<auto> args);
3889 public:
3890 
3891 
3892 protected:
3893  execData(AbstractSQLStatement stmt, *hash<auto> opt, *list<auto> args);
3894 public:
3895 
3896 
3897  static AbstractTable getTable(AbstractDatasource nds, string nname, *hash<auto> opts);
3898 
3899  static AbstractTable getTable(string dsstr, string nname, *hash<auto> opts);
3900 
3901  static AbstractTable getTable(hash<auto> dsh, string nname, *hash<auto> opts);
3902 
3903 protected:
3904  getColumnsUnlocked();
3905 public:
3906 
3907 
3908 protected:
3909  getPrimaryKeyUnlocked();
3910 public:
3911 
3912 
3913  // also loads primary key and constraints (for unique constraints)
3914 protected:
3915  getIndexesUnlocked();
3916 public:
3917 
3918 
3919 protected:
3920  getForeignConstraintsUnlocked(*hash<auto> opt);
3921 public:
3922 
3923 
3924 protected:
3925  addSourceConstraint(string table_name, AbstractForeignConstraint fk);
3926 public:
3927 
3928 
3929 protected:
3930  getConstraintsUnlocked();
3931 public:
3932 
3933 
3934 protected:
3935  getTriggersUnlocked();
3936 public:
3937 
3938 
3940 protected:
3941  bool hasReturningImpl();
3942 public:
3943 
3944 
3945 protected:
3946  softlist<auto> getDropSqlImpl();
3947 public:
3948 
3949 
3950 protected:
3951  string getTruncateSqlImpl();
3952 public:
3953 
3954 
3956 protected:
3957  auto tryExecArgsImpl(string sql, *softlist<auto> args);
3958 public:
3959 
3960 
3962 protected:
3963  auto tryExecRawImpl(string sql);
3964 public:
3965 
3966 
3968 protected:
3969  clearImpl();
3970 public:
3971 
3972 
3973 protected:
3974  preSetupTableImpl(reference desc, *hash<auto> opt);
3975 public:
3976 
3977 
3979 
3981 protected:
3982  abstract AbstractDataProviderType getNumericTypeImpl(string type_name, bool nullable, *hash<auto> options);
3983 public:
3984 
3985 protected:
3986  abstract *hash<auto> doReturningImpl(hash<auto> opt, reference<string> sql, list<auto> args);
3987 public:
3988 
3989 protected:
3990  abstract bool emptyImpl();
3991 public:
3992 
3994 protected:
3995  abstract *string getSqlValueImpl(auto v);
3996 public:
3997 
3999 
4002 protected:
4003  abstract bool checkExistenceImpl();
4004 public:
4005 
4007 protected:
4008  abstract bool supportsTablespacesImpl();
4009 public:
4010 
4012 protected:
4013  abstract bool constraintsLinkedToIndexesImpl();
4014 public:
4015 
4017 protected:
4018  abstract bool uniqueIndexCreatesConstraintImpl();
4019 public:
4020 
4021 protected:
4022  abstract setupTableImpl(hash<auto> desc, *hash<auto> opt);
4023 public:
4024 
4025 protected:
4026  abstract Columns describeImpl();
4027 public:
4028 protected:
4029  abstract AbstractPrimaryKey getPrimaryKeyImpl();
4030 public:
4031 protected:
4032  abstract Indexes getIndexesImpl();
4033 public:
4034 protected:
4035  abstract ForeignConstraints getForeignConstraintsImpl(*hash<auto> opt);
4036 public:
4037 protected:
4038  abstract Constraints getConstraintsImpl();
4039 public:
4040 protected:
4041  abstract Triggers getTriggersImpl();
4042 public:
4043 
4044 protected:
4045  abstract string getCreateTableSqlImpl(*hash<auto> opt);
4046 public:
4047 protected:
4048  abstract *list<auto> getCreateMiscSqlImpl(*hash<auto> opt, bool cache);
4049 public:
4050 protected:
4051  abstract string getCreateSqlImpl(list<auto> l);
4052 public:
4053 protected:
4054  abstract string getRenameSqlImpl(string new_name);
4055 public:
4056 protected:
4057  abstract *list<auto> getAlignSqlImpl(AbstractTable t, *hash<auto> opt);
4058 public:
4059 
4060 protected:
4061  abstract AbstractColumn addColumnImpl(string cname, hash<auto> opt, bool nullable = True);
4062 public:
4063 protected:
4064  abstract AbstractPrimaryKey addPrimaryKeyImpl(string cname, hash<auto> ch, *hash<auto> opt);
4065 public:
4066 protected:
4067  abstract AbstractIndex addIndexImpl(string iname, bool enabled, hash<auto> ch, *hash<auto> opt);
4068 public:
4069 protected:
4070  abstract AbstractForeignConstraint addForeignConstraintImpl(string cname, hash<auto> ch, string table, hash<auto> tch, *hash<auto> opt);
4071 public:
4072 protected:
4073  abstract AbstractCheckConstraint addCheckConstraintImpl(string cname, string src, *hash<auto> opt);
4074 public:
4075 protected:
4076  abstract AbstractUniqueConstraint addUniqueConstraintImpl(string cname, hash<auto> ch, *hash<auto> opt);
4077 public:
4078 
4079 protected:
4080  abstract AbstractTrigger addTriggerImpl(string tname, string src, *hash<auto> opt);
4081 public:
4082 
4084 protected:
4085  abstract bool tryInsertImpl(string sql, hash<auto> row);
4086 public:
4087 
4089 protected:
4090  abstract hash<auto> getQoreTypeMapImpl();
4091 public:
4092 
4094 protected:
4095  abstract hash<auto> getTypeMapImpl();
4096 public:
4097 
4099 protected:
4100  abstract doSelectOrderByWithOffsetSqlUnlockedImpl(reference<string> sql, reference<list<auto>> args, *hash<auto> qh, *hash<auto> jch, *hash<auto> ch, *hash<auto> psch, list coll);
4101 public:
4102 
4104 protected:
4105  abstract doSelectLimitOnlyUnlockedImpl(reference<string> sql, reference<list<auto>> args, *hash<auto> qh);
4106 public:
4107 
4109 protected:
4110  abstract copyImpl(AbstractTable old);
4111 public:
4112 
4114 
4118 protected:
4119  abstract AbstractSavepointHelper getSavepointHelperImpl(*string savepoint);
4120 public:
4121 
4123 
4125 protected:
4126  abstract bool isDuplicateRowErrorImpl(hash<ExceptionInfo> ex);
4127 public:
4128 };
4129 };
const SelectOptions
default possible select options; can be extended by driver-specific modules
Definition: AbstractTable.qc.dox.h:73
Constraints getConstraints()
returns a Constraints object describing the non-foreign constraints on the table
hash< auto > getCacheOptions()
returns the cache options for this driver
*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 UpsertAuto
Upsert option: if the target table is empty, use UpsertInsertFirst, otherwise use UpsertUpdateFirst...
Definition: AbstractTable.qc.dox.h:224
hash< auto > getColumnDescOptions()
returns the column description options for this driver
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
const TableOmissionOptions
alignment omission options
Definition: AbstractTable.qc.dox.h:77
AbstractDataField getColumnDataField(string column_name, *hash< auto > options, *string append_desc)
returns a field object for the given column
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, then the changes are effected in the database also immediately; otherwise it is only updated internally
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...
deprecated truncateNoCommit()
A legacy warpper for truncate()
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, but no "orderby" or "offset" arguments
bool hasReturningImpl()
returns True if the current database driver supports the "returning" clause in insert statements...
int delCommit()
SqlUtil::AbstractTable::delCommit() variant
hash< auto > getInsertFromIteratorOptions()
returns the insert from iterator options for this driver
bool checkExistence()
returns True if the table exists in the database, False if not
the base abstract class for the table implementation
Definition: AbstractTable.qc.dox.h:30
bool hasReturning()
returns True if the current database driver supports the "returning" clause in insert statements...
deprecated *hash upsertFromSelectNoCommit(AbstractTable t, *hash< auto > sh, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
A legacy SqlUtil::AbstractTable::upsertFromSelect() wrapper.
const ForeignConstraintOptions
default foreign constraint options
Definition: AbstractTable.qc.dox.h:62
*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 > getUpsertOptions()
returns the upsert options for this driver
const ColumnOptions
Column options; this is currently empty and can be extended in database-specific modules.
Definition: AbstractTable.qc.dox.h:138
the table container class stores a collection of tables in a schema
Definition: SqlUtil.qm.dox.h:5009
validateColumnOptions(string cname, reference< hash > opt, bool nullable)
validates column options
deprecated int upsertNoCommit(hash< auto > row, int upsert_strategy=UpsertAuto)
A legacy SqlUtil::AbstractTable::upsert() wrapper.
Qore::AbstractIterator getUniqueConstraintIterator()
returns an iterator for all unique constraints on the table (including the primary key if any) ...
drop(*hash< auto > opt)
drops the table from the database without any transaction management
hash< auto > getTableColumnDescOptions()
returns the table column description options for this driver
const UpsertResultLetterMap
maps upsert result codes to single letter symbols
Definition: AbstractTable.qc.dox.h:286
const UpsertStrategyMap
hash mapping upsert strategy codes to a text description
Definition: AbstractTable.qc.dox.h:243
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 > opts
option hash
Definition: AbstractSqlUtilBase.qc.dox.h:41
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...
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 UR_Inserted
row was inserted
Definition: AbstractTable.qc.dox.h:258
list< auto > getColumnSqlNames(softlist cols)
returns a list of column names for use in SQL strings; subclasses can process the argument list in ca...
string getSqlValue(auto v)
returns a string for use in SQL queries representing the DB-specific value of the argument ...
deprecated int delNoCommit(*hash cond, *reference< string > sql)
A legacy SqlUtil::AbstractTable::del() wrapper.
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...
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...
the abstract base class for index information
Definition: SqlUtil.qm.dox.h:5454
Triggers getTriggers()
returns an object of class Triggers describing the triggers on the table
*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 ...
auto tryExec(string sql)
executes some SQL with optional arguments so that if an error occurs the current transaction state is...
foreign constraint container class that throws an exception if an unknown constraint is accessed ...
Definition: SqlUtil.qm.dox.h:5793
const UpsertResultDescriptionMap
hash mapping upsert descriptions to codes
Definition: AbstractTable.qc.dox.h:282
const UR_Deleted
row was deleted (only possible with batch upsert methods such as AbstractTable::upsertFromIterator() ...
Definition: AbstractTable.qc.dox.h:270
const InsertFromIteratorOptions
default insert option keys
Definition: AbstractTable.qc.dox.h:176
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...
*hash< auto > getColumnOperatorMapImpl()
Reimplement in subclasses to provide driver specific column operators.
string getRenameSql(string new_name, *hash< auto > opt)
returns an SQL string that could be used to rename the table in the database
createCommit(*hash< auto > opt)
creates the table in the database; releases the transaction lock after creating the table ...
hash< auto > getInsertOptions()
returns the insert options for this driver
hash< auto > getWhereOperatorMap()
returns the "where" operator map for this object
hash< auto > getConstraintOptions()
returns the constraint options for this driver
AbstractColumn dropColumn(string cname, *reference lsql)
drops a column from the table
*hash< auto > insertCommit(hash< auto > row)
inserts a row into the table; the transaction is committed if successful, if an error occurs...
addCustomCopOperator(string name, hash< auto > operator)
register custom user column operator for this table object
constructor(AbstractDatasource nds, string nname, *hash nopts)
creates the object; private constructor
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 ...
truncateCommit()
truncates all the table data; releases the transaction lock after executing
hash< auto > getTableCreationOptions()
returns the table creation 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...
hash< auto > getColumnOperatorMap()
returns the column operator map for this object
deprecated dropNoCommit(*hash< auto > opt)
A legacy wrapper for drop()
const True
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...
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 > getUpdateOperatorMap()
returns the update operator map for this object
dropCommit(*hash< auto > opt)
drops the table from the database; releases the transaction lock after dropping 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
ForeignConstraints getForeignConstraints(*hash< auto > opt)
returns a ForeignConstraints object describing the foreign constraints that the table has on other ta...
abstract hash< auto > getTypeMapImpl()
returns the type name -> type description hash
const UpsertOptions
default upsert option keys
Definition: AbstractTable.qc.dox.h:168
hash< auto > getRawUpdateOperatorMap()
returns the raw (default) update operator map for this object
const CacheOptions
default cache options
Definition: AbstractTable.qc.dox.h:55
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...
Columns describe()
returns an object of class Columns describing the table
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...
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
ForeignConstraints foreignConstraints
foreign constraints description
Definition: AbstractTable.qc.dox.h:299
bool native_case
native case option
Definition: AbstractTable.qc.dox.h:305
string getCreateSqlString(*hash< auto > opt)
returns an SQL string that could be used to create the table and all known properties of the table ...
AbstractConstraint dropConstraint(string cname, *reference< string > sql)
drops a constraint from the table; this can be any constraint on the table, a primary key...
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...
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
hash< auto > getTriggerOptions()
returns the trigger options for this driver
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...
base class for abstract SqlUtil classes
Definition: AbstractSqlUtilBase.qc.dox.h:34
const UpsertUpdateFirst
Upsert option: update first, if the update fails, then insert.
Definition: AbstractTable.qc.dox.h:208
string getColumnSqlName(string col)
returns the column name for use in SQL strings; subclasses can return a special string in case the co...
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
auto tryExecRawImpl(string sql)
tries to execute a command so that if an error occurs the current transaction status is not lost ...
the base class for foreign key constraint information
Definition: SqlUtil.qm.dox.h:5859
AbstractDataProviderType getColumnDataType(string column_name, *hash< SqlUtilDataTypeOptionInfo > options)
returns the data type for the given column
const False
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...
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 ...
string getDropIndexSql(string iname, *hash< auto > opt)
gets the SQL that can be used to drop an index from the table
abstract class for check constraints
Definition: SqlUtil.qm.dox.h:5646
hash< auto > getSqlDataCallbackOptions()
returns the sql data operation callback options for this driver
hash< SqlResultInfo > insertWithInfo(hash< auto > row, *hash< auto > opt)
Inserts a row and returns the result and also the SQL used.
string getAlignSqlString(AbstractTable t, *hash< auto > opt)
accepts an AbstractTable argument and returns an SQL string that could be executed to align the struc...
abstract hash< auto > getQoreTypeMapImpl()
returns the qore type -> column type map
*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...
Qore AbstractDatabase class definition.
Definition: AbstractDatabase.qc.dox.h:32
bool empty()
returns True if the table has no definitions, False if not
string name
the table&#39;s name
Definition: AbstractTable.qc.dox.h:291
trigger container class that throws an exception if an unknown trigger is accessed ...
Definition: SqlUtil.qm.dox.h:6075
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...
Indexes indexes
index descriptions
Definition: AbstractTable.qc.dox.h:297
hash< auto > getAlignTableOptions()
returns the align table options for this driver
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...
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...
clearImpl()
clears any driver-specific table information
*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...
Abstract base class for savepoint helpers for epheremal transaction support.
Definition: AbstractSavepointHelper.qc.dox.h:33
const UR_Verified
row was updated unconditionally (not returned with UpsertSelectFirst)
Definition: AbstractTable.qc.dox.h:261
deprecated int insertFromSelectNoCommit(list cols, AbstractTable source, *hash< auto > sh, *reference< string > sql, *hash< auto > opt)
A legacy SqlUtil::AbstractTable::insertFromSelect() wrapper.
clear()
purges the current table definition
hash< auto > getInsertOperatorMap()
returns the insert operator map for this object
index container class that throws an exception if an unknown index is accessed
Definition: SqlUtil.qm.dox.h:5408
deprecated *hash upsertFromIteratorNoCommit(Qore::AbstractIterator i, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
A legacy SqlUtik::AbstractTable::upsertFromIterator() wrapper.
const TableOptions
table options
Definition: AbstractTable.qc.dox.h:38
AbstractSavepointHelper getSavepointHelper(*string savepoint)
get DB-specific savepoint helper
*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 insertFromIterator(Qore::AbstractIterator i, *hash< auto > opt)
this method inserts data from the given iterator argument (whose getValue() method must return a hash...
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...
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, then it is added in the database also immediately; otherwise it is only added internally and can be created when create() is called for example
AbstractPrimaryKey primaryKey
primary key description
Definition: AbstractTable.qc.dox.h:295
list< auto > list(...)
bool manual
manual edits
Definition: AbstractTable.qc.dox.h:309
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...
const AlignTableOptions
table alignment options
Definition: AbstractTable.qc.dox.h:96
AbstractPrimaryKey getPrimaryKey()
returns an object of class AbstractPrimaryKey describing the primary key of the table ...
bool emptyData()
returns True if the table has no data rows, False if not
string getBaseType()
returns the base type of the underlying object (normally "table", some DB-specific implementations ma...
softlist< auto > getDropSql(*hash< auto > opt)
returns the sql required to drop the table; reimplement in subclasses if necessary ...
*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...
abstract bool hasArrayBind()
returns True if the underlying DB driver supports bulk DML operations
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...
Triggers triggers
trigger descriptions
Definition: AbstractTable.qc.dox.h:303
string getDesc()
returns a descriptive string of the datasource (without the password) and the table name (with a poss...
abstract *string getSqlValueImpl(auto v)
returns a string for use in SQL queries representing the DB-specific value of the argument; returns N...
const CreationOptions
default generic creation options
Definition: AbstractDatabase.qc.dox.h:124
int del()
SqlUtil::AbstractTable::del() variant
*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...
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 ...
string getSqlName()
returns the name of the table to be used in SQL (with a possible qualifier for schema, etc)
*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...
string getCreateTableSql(*hash< auto > opt)
returns an SQL string that could be used to create the basic table structure without indexes and cons...
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
hash< auto > getSelectOptions()
returns the select options for this driver
Columns columns
column description object
Definition: AbstractTable.qc.dox.h:293
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...
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...
the API for a constraint with columns
Definition: SqlUtil.qm.dox.h:5699
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...
abstract bool uniqueIndexCreatesConstraintImpl()
returns True if the database automatically creates a unique constraint when a unique index is created...
deprecated int insertFromIteratorNoCommit(Qore::AbstractIterator i, *hash< auto > opt)
A legacy SqlUtil::AbstractTable::insertFromIterator() wrapper.
const SqlDataCallbackOptions
generic SQL data operation callbacks
Definition: AbstractTable.qc.dox.h:145
copy(AbstractTable old)
copies the object
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...
bool asteriskRequiresPrefix()
returns True if the database requires a wildcard "*" to be prefixed with the table name when it appea...
const UpsertResultMap
hash mapping upsert results to a description
Definition: AbstractTable.qc.dox.h:276
*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...
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, then it is added in the database also immediately; otherwise it is only added internally and can be created when create() is called for example
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...
bool bindEmptyStringsAsNull()
returns True if the DB treats empty strings as NULL, False if not; by default this method returns Fal...
hash< SqlCommandInfo > getUpdateSql(hash< auto > set, *hash< auto > cond)
Returns the SQL for the given update parameters.
auto tryExecRaw(string sql)
executes some SQL so that if an error occurs the current transaction state is not lost ...
auto tryExecArgs(string sql, *softlist< auto > args)
executes some SQL with optional arguments so that if an error occurs the current transaction state is...
abstract copyImpl(AbstractTable old)
db-specific copy actions
Constraints constraints
constraint descriptions
Definition: AbstractTable.qc.dox.h:301
*hash< auto > insert(hash< auto > row)
inserts a row into the table without any transaction management; a transaction will be in progress af...
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...
string type(auto arg)
create(*hash< auto > opt)
creates the table with all associated properties (indexes, constraints, etc) without any transaction ...
abstract bool constraintsLinkedToIndexesImpl()
returns True if the database links constraints to indexes (ie dropping the constraint drops the index...
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 ...
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
hash< auto > hash(object obj)
const InsertOptions
generic SQL insert options
Definition: AbstractTable.qc.dox.h:158
setupTable(hash< auto > desc, *hash< auto > opt)
creates the object from a table description hash
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 TriggerOptions
default trigger options
Definition: AbstractTable.qc.dox.h:68
deprecated int updateNoCommit(hash set, *hash cond, *reference< string > sql)
A legacy SqlUtil::AbstractTable::update() wrapper.
deprecated *hash< auto > insertNoCommit(hash< auto > row, *reference< string > sql, *hash< auto > opt)
A legacy wrapper for SqlUtil::AbstractTable::insert()
*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...
softint rowCount()
returns the number of rows in the table
rollback()
rolls back the current transaction on the underlying Qore::SQL::AbstractDatasource ...
hash< auto > getForeignConstraintOptions()
return the foreign constraint options for this driver
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...
const UpsertUpdateOnly
Upsert option: update if the row exists, otherwise ignore.
Definition: AbstractTable.qc.dox.h:238
column container class that throws an exception if an unknown column is accessed
Definition: SqlUtil.qm.dox.h:5197
the base class for triggers
Definition: SqlUtil.qm.dox.h:6057
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...
setDatasource(AbstractDatasource nds)
changes the datasource for the table; if the inDb flag is True, then it is set to False by calling th...
Indexes getIndexes()
returns an object of class Indexes describing the indexes on the table
const UR_Unchanged
row was unchanged (only possible with UpsertSelectFirst, UpsertInsertOnly, and UpsertUpdateOnly) ...
Definition: AbstractTable.qc.dox.h:267
AbstractPrimaryKey dropPrimaryKey(*reference lsql)
drops the primary key from the table; if the table is known to be in the database already...
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 ...
const UR_Updated
row was updated because it was different (only possible with UpsertSelectFirst)
Definition: AbstractTable.qc.dox.h:264
the base class for column information
Definition: SqlUtil.qm.dox.h:5279
truncate()
truncates all the table data without any transaction management
*hash< string, AbstractDataField > getRecordType()
returns a record description for the table
const UpsertInsertOnly
Upsert option: insert if the row does not exist, otherwise ignore.
Definition: AbstractTable.qc.dox.h:231
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...
string getName()
returns the name of the table
transient Mutex l()
mutex for atomic actions
represents a database table; this class embeds an AbstractTable object that is created automatically ...
Definition: Table.qc.dox.h:50
const IndexOptions
default index options
Definition: AbstractTable.qc.dox.h:46
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...
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...
const UpsertSelectFirst
Upsert option: select first, if the row is unchanged, do nothing, if it doesn&#39;t exist, insert, otherwise update.
Definition: AbstractTable.qc.dox.h:217
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...
AbstractTable getSubtableFromString(string table, *hash< auto > opt)
Returns the given table from the argument, using any "tablecode" option if present.
const UpsertInsertFirst
Upsert option: insert first, if the insert fails, then update.
Definition: AbstractTable.qc.dox.h:200
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, returns True
*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 > 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...
const ColumnDescOptions
Column description options.
Definition: AbstractTable.qc.dox.h:127
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...
bool inDb()
returns True if the table has been read from or created in the database, False if not ...
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...
*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 ...
abstract bool isDuplicateRowErrorImpl(hash< ExceptionInfo > ex)
Returns True if the exception was raised because of a duplicate row / key error.
const TableDescriptionHashOptions
Table description options.
Definition: AbstractTable.qc.dox.h:111
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...
list< auto > getDropPrimaryKeySql(*hash< auto > opt)
gets a list of SQL strings that can be used to drop the primary key from the table ...
commit()
commits the current transaction on the underlying Qore::SQL::AbstractDatasource
*AbstractUniqueConstraint findUniqueConstraint(string name)
returns the given AbstractUniqueConstraint object if defined for the table (also includes the primary...
const TableCreationOptions
table creation options
Definition: AbstractTable.qc.dox.h:84
deprecated createNoCommit(*hash< auto > opt)
A legacy wrapper for create()
string getSqlFromList(list< auto > l)
returns an SQL string corresponding to the list of commands in the argument
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...
hash< auto > getTableDescriptionHashOptions()
returns the table description hash<auto> options for this driver
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 ...
abstract bool checkExistenceImpl()
returns True if the table exists in the DB, False if not
bool isDuplicateRowError(hash< ExceptionInfo > ex)
Returns True if the exception was raised because of a duplicate row / key error.
list< auto > getDropTriggerSql(string tname, *hash< auto > opt)
returns SQL that can be used to drop the given trigger from the table
list< auto > getDropColumnSql(string cname, *hash< auto > opt)
returns the SQL that can be used to drop a column from the table
string getTruncateSql(*hash< auto > opt)
gets the SQL that can be used to truncate the table
*hash< auto > findSingle(*hash< auto > cond)
finds a single row in the table that match the row condition passed; multiple rows may match...
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
*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...
represents a primary key
Definition: SqlUtil.qm.dox.h:5782
cache(*hash< auto > opts)
reads in all attributes of the table from the database
hash< auto > getIndexOptions()
returns the index options for this driver
string join(string str,...)
const UpsertStrategyDescriptionMap
hash mapping upsert strategy descriptions to upsert strategy codes
Definition: AbstractTable.qc.dox.h:249
*hash< auto > getPseudoColumnHash()
returns a hash of valid pseudocolumns
const ConstraintOptions
default constraint options
Definition: AbstractTable.qc.dox.h:52
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
abstract AbstractSavepointHelper getSavepointHelperImpl(*string savepoint)
get DB-specific savepoint helper
hash< auto > getColumnOptions()
returns the column options for this driver
represents a unique column constraint
Definition: SqlUtil.qm.dox.h:5773
const AdditionalColumnDescOptions
additional column description keys valid when describing columns in a table description hash ...
Definition: AbstractTable.qc.dox.h:134
hash< auto > getTableOptions()
returns the table options for this driver
abstract base class for constraints
Definition: SqlUtil.qm.dox.h:5584
abstract bool supportsTablespacesImpl()
returns True if the database support tablespaces
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
AbstractForeignConstraint removeForeignConstraint(string cname)
removes the named foreign constraint from the table; no SQL is executed in any case, only the named foreign constraint is removed from the table definition
constraint container class that throws an exception if an unknown constraint is accessed ...
Definition: SqlUtil.qm.dox.h:5542