Qore SqlUtil Module Reference  1.7
AbstractTable.qc.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
25 // minimum required Qore version
26 // assume local scope for variables, do not use "$" signs
27 // require type definitions everywhere
29 // enable all warnings
30 
32 namespace SqlUtil {
34 
37 
38 public:
40 
44  const TableOptions = ...;
45 
46 
48 
52  const IndexOptions = ...;
53 
54 
56 
59 
61  const CacheOptions = ...;
62 
63 
65 
69 
70 
72 
75 
77 
79  const SelectOptions = ...;
80 
81 
83  const TableOmissionOptions = ...;
84 
85 
87 
90  const TableCreationOptions = ...;
91 
92 
94 
102  const AlignTableOptions = ...;
103 
104 
106 
118 
119 
121 
133  const ColumnDescOptions = ...;
134 
135 
137 
141 
142 
144  const ColumnOptions = {};
145 
147 
152 
153 
155 
164  const InsertOptions = ...;
165 
166 
168 
174  const UpsertOptions = ...;
175 
176 
178 
183 
184 
200 
206  const UpsertInsertFirst = 1;
207 
209 
214  const UpsertUpdateFirst = 2;
215 
217 
223  const UpsertSelectFirst = 3;
224 
226 
230  const UpsertAuto = 4;
231 
233 
237  const UpsertInsertOnly = 5;
238 
240 
244  const UpsertUpdateOnly = 6;
245 
247 
249  const UpsertStrategyMap = ...;
250 
251 
253 
256 
258 
263  const UR_Inserted = 1;
265 
267  const UR_Verified = 2;
268 
270  const UR_Updated = 3;
271 
273  const UR_Unchanged = 4;
274 
276  const UR_Deleted = 5;
278 
280 
282  const UpsertResultMap = ...;
283 
284 
286 
289 
290 
293 
294 
295 protected:
297  string name;
313  bool inDb = False;
315  bool manual = False;
316 
317  hash m_customCopMap = {};
318 
319 public:
320 
322 
330 protected:
331  constructor(AbstractDatasource nds, string nname, *hash nopts) ;
332 public:
333 
334 
337 
338 
340 
351  setDatasource(AbstractDatasource nds);
352 
353 
354 protected:
355  doTableOptions(*hash nopts);
356 public:
357 
358 
361 
362 
365 
366 
368 
377  bool inDb();
378 
379 
381 
389 
390 
392 
403  dropCommit(*hash<auto> opt);
404 
405 
407 
418  drop(*hash<auto> opt);
419 
420 
422  deprecated dropNoCommit(*hash<auto> opt);
423 
425 
436  auto tryExec(string sql);
437 
438 
440 
450  auto tryExecArgs(string sql, *softlist<auto> args);
451 
452 
454 
465  auto tryExecRaw(string sql);
466 
467 
469 
480  softlist<auto> getDropSql(*hash<auto> opt);
481 
482 
484 
492 
493 
495 
503 
504 
506  deprecated truncateNoCommit();
507 
509 
524  string getTruncateSql(*hash<auto> opt);
525 
526 
528 
537  createCommit(*hash<auto> opt);
538 
539 
541 
552  create(*hash<auto> opt);
553 
554 
556  deprecated createNoCommit(*hash<auto> opt);
557 
559 
570  rename(string new_name, *reference<string> sql, *Tables table_cache);
571 
572 
573 protected:
574  doRenameIntern(string new_name, *Tables table_cache);
575 public:
576 
577 
579 
590  bool emptyData();
591 
592 
594 
603  bool empty();
604 
605 
606 protected:
607  bool emptyUnlocked();
608 public:
609 
610 
612 
618  setupTable(hash<auto> desc, *hash<auto> opt);
619 
620 
622 
646  AbstractColumn addColumn(string cname, hash<auto> opt, bool nullable = True, *reference lsql);
647 
648 
650 
679  list<auto> getAddColumnSql(string cname, hash copt, bool nullable = True, *hash<auto> opt);
680 
681 
682 protected:
683  AbstractColumn addColumnUnlocked(string cname, hash<auto> opt, bool nullable = True, *reference lsql, bool do_exec = True, bool modify_table = True);
684 public:
685 
686 
687 protected:
688  addColumnToTableUnlocked(AbstractColumn c);
689 public:
690 
691 
693 
718  AbstractColumn modifyColumn(string cname, hash<auto> opt, bool nullable = True, *reference lsql);
719 
720 
722 
749  list<auto> getModifyColumnSql(string cname, hash copt, bool nullable = True, *hash<auto> opt);
750 
751 
753 
770  AbstractColumn renameColumn(string old_name, string new_name, reference<string> sql);
771 
772 
774 
792  string getRenameColumnSql(string old_name, string new_name, *hash<auto> opt);
793 
794 
795 protected:
796  AbstractColumn renameColumnIntern(AbstractColumn c, string new_name);
797 public:
798 
799 
800 protected:
801  validateOptionsIntern(string err, hash ropt, reference<hash> opt);
802 public:
803 
804 
805 protected:
806  validateOptionsIntern(string err, hash ropt, reference<hash> opt, string tag);
807 public:
808 
809 
810 protected:
811  execSql(softlist lsql);
812 public:
813 
814 
816 
836  AbstractPrimaryKey addPrimaryKey(string pkname, softlist cols, *hash<auto> opt, *reference<string> sql);
837 
838 
840 
862  string getAddPrimaryKeySql(string pkname, softlist cols, *hash pkopt, *hash<auto> opt);
863 
864 
865 protected:
866  setPrimaryKeyUnlocked(AbstractPrimaryKey pk);
867 public:
868 
869 
870 protected:
871  AbstractPrimaryKey addPrimaryKeyUnlocked(string pkname, softlist cols, *hash<auto> opt, *reference<string> sql);
872 public:
873 
874 
875 protected:
876  AbstractPrimaryKey addPrimaryKeyUnlockedIntern(string pkname, softlist cols, *hash<auto> opt, *reference<string> sql);
877 public:
878 
879 
881 
897  list<auto> getDropAllConstraintsAndIndexesOnColumnSql(string cname, *hash<auto> opt);
898 
899 
900 protected:
901  list<auto> getDropAllConstraintsAndIndexesOnColumnSqlUnlocked(string cname, *hash<auto> opt);
902 public:
903 
904 
906 
925  list<auto> getDropPrimaryKeySql(*hash<auto> opt);
926 
927 
929 
948 
949 
951 
972  AbstractUniqueConstraint addUniqueConstraint(string cname, softlist cols, *hash<auto> opt, *reference<string> sql);
973 
974 
976 
996  string getAddUniqueConstraintSql(string cname, softlist cols, *hash ukopt, *hash<auto> opt);
997 
998 
999 protected:
1000  AbstractUniqueConstraint addUniqueConstraintUnlocked(string cname, softlist cols, *hash<auto> opt, *reference<string> sql);
1001 public:
1002 
1003 
1004 protected:
1005  AbstractUniqueConstraint addUniqueConstraintUnlockedIntern(string cname, softlist cols, *hash<auto> opt, *reference<string> sql);
1006 public:
1007 
1008 
1010 
1031  AbstractIndex addIndex(string iname, bool unique, softlist cols, *hash<auto> opt, *reference<string> sql);
1032 
1033 
1035 
1056  string getAddIndexSql(string iname, bool unique, softlist cols, *hash<auto> ixopt, *hash<auto> opt);
1057 
1058 
1059 protected:
1060  AbstractIndex addIndexUnlocked(string iname, bool unique, softlist cols, *hash<auto> opt, *reference<string> sql);
1061 public:
1062 
1063 
1064 protected:
1065  AbstractIndex addIndexUnlockedIntern(string iname, bool unique, softlist cols, *hash<auto> opt, *reference<string> sql);
1066 public:
1067 
1068 
1070 
1082  AbstractIndex renameIndex(string old_name, string new_name, reference<string> sql);
1083 
1084 
1086 
1104  AbstractIndex dropIndex(string iname, *reference<string> sql);
1105 
1106 
1108 
1127  string getDropIndexSql(string iname, *hash<auto> opt);
1128 
1129 
1131 
1153  AbstractForeignConstraint addForeignConstraint(string cname, softlist cols, string table, *softlist tcols, *hash<auto> opt, *reference<string> sql);
1154 
1155 
1157 
1179  string getAddForeignConstraintSql(string cname, softlist cols, string table, *softlist tcols, *hash fkopt, *hash<auto> opt);
1180 
1181 
1182 protected:
1183  Columns getReferencedTableColumnsUnlocked(string table, *Tables cache, string err = 'FOREIGN-CONSTRAINT-ERROR');
1184 public:
1185 
1186 
1187 protected:
1188  AbstractForeignConstraint addForeignConstraintUnlocked(string cname, softlist cols, string table, *softlist tcols, *hash<auto> opt, *reference<string> sql);
1189 public:
1190 
1191 
1192 protected:
1193  AbstractForeignConstraint addForeignConstraintUnlockedIntern(string cname, softlist cols, string table, *softlist tcols, *hash<auto> opt, *reference<string> sql);
1194 public:
1195 
1196 
1198 
1216  AbstractForeignConstraint dropForeignConstraint(string cname, *reference<string> sql);
1217 
1218 
1220 
1236 
1237 
1239 
1259  AbstractCheckConstraint addCheckConstraint(string cname, string src, *hash<auto> opt, *reference<string> sql);
1260 
1261 
1263 
1285  string getAddCheckConstraintSql(string cname, string src, *hash copt, *hash<auto> opt);
1286 
1287 
1288 protected:
1289  AbstractCheckConstraint addCheckConstraintUnlocked(string cname, string src, *hash<auto> opt, *reference<string> sql);
1290 public:
1291 
1292 
1293 protected:
1294  AbstractCheckConstraint addCheckConstraintUnlockedIntern(string cname, string src, *hash<auto> opt, *reference<string> sql);
1295 public:
1296 
1297 
1299 
1311  AbstractConstraint renameConstraint(string old_name, string new_name, reference lsql);
1312 
1313 
1315 
1334  string getDropConstraintSql(string cname, *hash<auto> opt);
1335 
1336 
1338 
1357  *string getDropConstraintIfExistsSql(string cname, *hash<auto> opt, *reference<AbstractConstraint> cref);
1358 
1359 
1360 protected:
1361  AbstractConstraint findDropConstraintUnlocked(string cname, reference<code> rmv);
1362 public:
1363 
1364 
1366 
1384  AbstractConstraint dropConstraint(string cname, *reference<string> sql);
1385 
1386 
1388 
1408  AbstractTrigger addTrigger(string tname, string src, *hash<auto> opt, *reference lsql);
1409 
1410 
1412 
1434  list<auto> getAddTriggerSql(string tname, string src, *hash topt, *hash<auto> opt);
1435 
1436 
1437 protected:
1438  AbstractTrigger addTriggerUnlocked(string tname, string src, *hash<auto> opt, *reference lsql);
1439 public:
1440 
1441 
1442 protected:
1443  AbstractTrigger addTriggerUnlockedIntern(string tname, string src, *hash<auto> opt, *reference lsql);
1444 public:
1445 
1446 
1448 
1466  AbstractTrigger dropTrigger(string tname, *reference<string> sql);
1467 
1468 
1470 
1489  list<auto> getDropTriggerSql(string tname, *hash<auto> opt);
1490 
1491 
1492 protected:
1493  getAllConstraintsUnlocked(*hash<auto> opt);
1494 public:
1495 
1496 
1497 protected:
1498  checkUniqueConstraintName(string err, string cname);
1499 public:
1500 
1501 
1502 protected:
1503  checkUniqueConstraintNameValidateOptions(string err, string cname, hash ropt, reference<hash> opt);
1504 public:
1505 
1506 
1508 protected:
1509  validateColumnOptions(string cname, reference<hash> opt, bool nullable);
1510 public:
1511 
1512 
1514 
1532  AbstractColumn dropColumn(string cname, *reference lsql);
1533 
1534 
1536 
1555  list<auto> getDropColumnSql(string cname, *hash<auto> opt);
1556 
1557 
1559 
1570  *hash<auto> insertCommit(hash<auto> row);
1571 
1572 
1574 
1578  *hash<auto> insertCommit(hash<auto> row, reference<string> sql);
1579 
1580 
1582 
1586  *hash<auto> insertCommit(hash<auto> row, hash<auto> opt);
1587 
1588 
1590 
1595  *hash<auto> insertCommit(hash<auto> row, reference<string> sql, hash<auto> opt);
1596 
1597 
1599 
1611  *hash<auto> insert(hash<auto> row);
1612 
1613 
1615 
1619  *hash<auto> insert(hash<auto> row, reference<string> sql);
1620 
1621 
1623 
1627  *hash<auto> insert(hash<auto> row, hash<auto> opt);
1628 
1629 
1631 
1636  *hash<auto> insert(hash<auto> row, reference<string> sql, hash<auto> opt);
1637 
1638 
1640 
1649  hash<SqlResultInfo> insertWithInfo(hash<auto> row, *hash<auto> opt);
1650 
1651 
1653  deprecated *hash<auto> insertNoCommit(hash<auto> row, *reference<string> sql, *hash<auto> opt);
1654 
1656  deprecated *hash<auto> insertNoCommit(hash<auto> row, hash<auto> opt);
1657 
1658 protected:
1659  *hash<auto> insertIntern(hash<auto> row, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
1660 public:
1661 
1662 
1663 protected:
1664  hash<auto> getPlaceholdersAndValues(hash<auto> row);
1665 public:
1666 
1667 
1669 
1673 
1674 
1676 
1695  int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh, reference<string> sql, hash<auto> opt);
1696 
1697 
1700 
1701 
1703  int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh);
1704 
1705 
1707  int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh, reference<string> sql);
1708 
1709 
1711  int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh, hash<auto> opt);
1712 
1713 
1715 
1734  int insertFromSelect(list cols, AbstractTable source, hash<auto> sh, reference<string> sql, hash<auto> opt);
1735 
1736 
1739 
1740 
1742  int insertFromSelect(list cols, AbstractTable source, hash<auto> sh);
1743 
1744 
1746  int insertFromSelect(list cols, AbstractTable source, hash<auto> sh, reference<string> sql);
1747 
1748 
1750  int insertFromSelect(list cols, AbstractTable source, hash<auto> sh, hash<auto> opt);
1751 
1752 
1754 
1767  hash<SqlResultInfo> insertFromSelectWithInfo(list<auto> cols, AbstractTable source, hash<auto> select_hash, *hash<auto> opt);
1768 
1769 
1771  deprecated int insertFromSelectNoCommit(list cols, AbstractTable source, *hash<auto> sh, *reference<string> sql, *hash<auto> opt);
1772 
1773 protected:
1774  int insertFromSelectIntern(list cols, AbstractTable source, *hash<auto> sh, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
1775 public:
1776 
1777 
1779 
1798 
1799 
1801 
1820 
1821 
1823  deprecated int insertFromIteratorNoCommit(Qore::AbstractIterator i, *hash<auto> opt);
1824 
1825 protected:
1826  int insertFromIteratorIntern(Qore::AbstractIterator i, *hash<auto> opt);
1827 public:
1828 
1829 
1831 
1847  int upsertCommit(hash<auto> row, int upsert_strategy = UpsertAuto, *hash<auto> opt);
1848 
1849 
1851 
1867  int upsert(hash<auto> row, int upsert_strategy = UpsertAuto, *hash<auto> opt);
1868 
1869 
1871  deprecated int upsertNoCommit(hash<auto> row, int upsert_strategy = UpsertAuto);
1872 
1874 
1895  code getUpsertClosure(hash<auto> row, int upsert_strategy = UpsertAuto, *hash<auto> opt);
1896 
1897 
1899 
1926  code getBulkUpsertClosure(hash example_row, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
1927 
1928 
1930 
1951  code getUpsertClosureWithValidation(hash example_row, int upsert_strategy = UpsertAuto, *hash<auto> opt);
1952 
1953 
1955 
1988 
1989 
1991 
2023  *hash upsertFromIterator(Qore::AbstractIterator i, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2024 
2025 
2027  deprecated *hash upsertFromIteratorNoCommit(Qore::AbstractIterator i, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2028 
2029 protected:
2030  *hash upsertFromIteratorIntern(Qore::AbstractIterator i, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2031 public:
2032 
2033 
2034 protected:
2035  *hash<auto> doDeleteOthersIntern(hash pkh, *hash<auto> opt);
2036 public:
2037 
2038 
2040 
2078  *hash upsertFromSelectCommit(AbstractTable t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2079 
2080 
2082  *hash upsertFromSelectCommit(Table t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2083 
2084 
2086 
2126  *hash upsertFromSelect(AbstractTable t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2127 
2128 
2130  deprecated *hash upsertFromSelectNoCommit(AbstractTable t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2131 
2133  deprecated *hash upsertFromSelect(Table t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2134 
2136  deprecated *hash upsertFromSelectNoCommit(Table t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2137 
2139 
2150  softint rowCount();
2151 
2152 
2154 
2175  Qore::SQL::SQLStatement getRowIterator(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2176 
2177 
2179 
2202  Qore::SQL::SQLStatement getRowIteratorNoExec(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2203 
2204 
2206 
2226  Qore::SQL::SQLStatement getRowIterator(*hash<auto> sh, *hash<auto> opt);
2227 
2228 
2230 
2252  Qore::SQL::AbstractSQLStatement getStatement(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2253 
2254 
2256 
2277  Qore::SQL::AbstractSQLStatement getStatement(*hash<auto> sh, *hash<auto> opt);
2278 
2279 
2281 
2313  hash<SqlResultInfo> getStatementWithInfo(*hash<auto> select_hash, *hash<auto> opt);
2314 
2315 
2317 
2339  Qore::SQL::AbstractSQLStatement getStatementNoExec(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2340 
2341 
2343 
2371  hash<SqlResultInfo> getStatementNoExecWithInfo(*hash<auto> select_hash, *hash<auto> opt);
2372 
2373 
2375 
2396  Qore::SQL::AbstractSQLStatement getStatementNoExec(*hash<auto> sh, *hash<auto> opt);
2397 
2398 
2399 protected:
2400  Qore::SQL::AbstractSQLStatement getStatementIntern(*hash<auto> sh, *reference<string> sql, *hash<auto> opt, *bool no_exec, *reference<softlist<auto>> args);
2401 public:
2402 
2403 
2405 
2424  *hash<auto> selectRow(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2425 
2426 
2427 protected:
2428  *hash<auto> selectRowIntern(*hash<auto> sh, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
2429 public:
2430 
2431 
2433 
2459  hash<SqlResultInfo> selectRowWithInfo(*hash<auto> select_hash, *hash<auto> opt);
2460 
2461 
2463 
2483  *list<auto> selectRows(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2484 
2485 
2486 protected:
2487  *list<auto> selectRowsIntern(*hash<auto> sh, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
2488 public:
2489 
2490 
2492 
2517  hash<SqlResultInfo> selectRowsWithInfo(*hash<auto> select_hash, *hash<auto> opt);
2518 
2519 
2521 
2540  *hash<auto> select(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2541 
2542 
2543 protected:
2544  *hash<auto> selectIntern(*hash<auto> sh, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
2545 public:
2546 
2547 
2549 
2574  hash<SqlResultInfo> selectWithInfo(*hash<auto> select_hash, *hash<auto> opt);
2575 
2576 
2578 
2596  *hash<auto> selectRow(*hash<auto> sh, *hash<auto> opt);
2597 
2598 
2600 
2617  *list selectRows(*hash<auto> sh, *hash<auto> opt);
2618 
2619 
2621 
2638  *hash<auto> select(*hash<auto> sh, *hash<auto> opt);
2639 
2640 
2642 
2660  string getSelectSql(*hash<auto> sh, *reference<list<auto>> args);
2661 
2662 
2663  *AbstractUniqueConstraint matchAnyUnique(list cols);
2664 
2665 
2666  string getSelectSqlIntern(*hash<auto> qh, reference<list<auto>> args, *hash<auto> opt);
2667 
2668 
2669  string getSelectSqlUnlocked(*hash<auto> qh, reference<list<auto>> args, *hash<auto> opt);
2670 
2671 
2672  // column & table information must be retrieved before calling this function
2673  string getSelectSqlUnlockedIntern(*hash<auto> qh, string from, reference<list<auto>> args, *hash<auto> ch, *hash<auto> opt);
2674 
2675 
2677  AbstractTable getSubtableFromString(string table, *hash<auto> opt);
2678 
2679 
2680 protected:
2681  string getFromIntern(string from, *hash<auto> qh);
2682 public:
2683 
2684 
2685 protected:
2686  list<auto> getGroupByListUnlocked(hash<auto> qh, *hash<auto> jch, *hash<auto> ch, *hash<auto> psch, list coll);
2687 public:
2688 
2689 
2690 protected:
2691  list<auto> getOrderByListUnlocked(hash<auto> qh, *hash<auto> jch, *hash<auto> ch, *hash<auto> psch, list coll);
2692 public:
2693 
2694 
2695 protected:
2696  list<auto> getGroupOrderByListUnlocked(string key, hash<auto> qh, *hash<auto> jch, *hash<auto> ch, *hash<auto> psch, list coll);
2697 public:
2698 
2699 
2700 protected:
2701  doForUpdate(reference<string> sql);
2702 public:
2703 
2704 
2705 protected:
2706  string getSelectSqlName(*hash<auto> qh);
2707 public:
2708 
2709 
2710 protected:
2711  string getColumnExpressionIntern(auto cvc, *hash<auto> jch, bool join, *hash<auto> ch, *hash<auto> psch);
2712 public:
2713 
2714 
2715 protected:
2716  string doColumnOperatorIntern(hash cvc, *hash<auto> jch, bool join, *hash<auto> ch, *hash<auto> psch, *reference psch_ref);
2717 public:
2718 
2719 
2720 protected:
2721  string doColumnOperatorIntern(auto cop, auto arg, *string cve, hash cm, *hash<auto> jch, bool join, *hash<auto> ch, *hash<auto> psch, *reference psch_ref);
2722 public:
2723 
2724 
2725 protected:
2726  string getColumnNameIntern(string cv, *hash<auto> jch, bool join, *hash<auto> ch, *hash<auto> psch);
2727 public:
2728 
2729 
2731 protected:
2733 public:
2734 
2735 
2736 protected:
2737  getSelectWhereSqlUnlocked(reference<string> sql, reference<list<auto>> args, *hash<auto> qh, *hash<auto> jch, bool join = False, *hash<auto> ch, *hash<auto> psch);
2738 public:
2739 
2740 
2741 protected:
2742  *string getWhereClause(*hash cond, reference<list<auto>> args, *string cprefix, *hash<auto> jch, bool join = False);
2743 public:
2744 
2745 
2746 protected:
2747  *string getWhereClause(list cond, reference<list<auto>> args, *string cprefix, *hash<auto> jch, bool join = False);
2748 public:
2749 
2750 
2751 protected:
2752  *string getWhereClauseUnlocked(list cond, reference<list<auto>> args, *string cprefix, *hash<auto> jch, bool join = False, *hash pch, *hash<auto> psch);
2753 public:
2754 
2755 
2756 protected:
2757  *string getWhereClauseUnlocked(*hash cond, reference<list<auto>> args, *string cprefix, *hash<auto> jch, bool join = False, *hash pch, *hash<auto> psch);
2758 public:
2759 
2760 
2761 protected:
2762  *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);
2763 public:
2764 
2765 
2766 protected:
2767  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);
2768 public:
2769 
2770 
2771  string getOrClause(list<auto> arglist, reference<list<auto>> args, *hash<auto> jch, bool join = False, *hash<auto> ch, *hash<auto> psch);
2772 
2773 
2774  string getOrClause(hash<auto> arg, reference<list<auto>> args, *hash<auto> jch, bool join = False, *hash<auto> ch, *hash<auto> psch);
2775 
2776 
2777 protected:
2778  doSelectOrderBySqlUnlocked(reference<string> sql, reference<list<auto>> args, *hash<auto> qh, *hash<auto> jch, *hash<auto> ch, *hash<auto> psch, list coll);
2779 public:
2780 
2781 
2783 
2798  int delCommit(hash cond, reference<string> sql, hash<auto> opt);
2799 
2800 
2802  int delCommit(hash cond, hash<auto> opt);
2803 
2804 
2806  int delCommit(hash cond, reference<string> sql);
2807 
2808 
2810  int delCommit(hash cond);
2811 
2812 
2814  int delCommit();
2815 
2816 
2818 
2833  int del(hash cond, reference<string> sql, hash<auto> opt);
2834 
2835 
2837  int del(hash cond, hash<auto> opt);
2838 
2839 
2841  int del(hash cond, reference<string> sql);
2842 
2843 
2845  int del(hash cond);
2846 
2847 
2849  int del();
2850 
2851 
2853 
2867  hash<SqlResultInfo> delWithInfo(hash<auto> cond, *hash<auto> opt);
2868 
2869 
2871  deprecated int delNoCommit(*hash cond, *reference<string> sql);
2872 
2873 protected:
2874  int delIntern(*hash<auto> cond, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
2875 public:
2876 
2877 
2879 
2896  int updateCommit(hash set, hash cond, reference<string> sql, hash<auto> opt);
2897 
2898 
2900  int updateCommit(hash set, hash cond, reference<string> sql);
2901 
2902 
2904  int updateCommit(hash set, hash cond, hash<auto> opt);
2905 
2906 
2908  int updateCommit(hash set, hash cond);
2909 
2910 
2912  int updateCommit(hash set);
2913 
2914 
2916 
2933  int update(hash set, hash cond, reference<string> sql, hash<auto> opt);
2934 
2935 
2937  int update(hash set, hash cond, reference<string> sql);
2938 
2939 
2941  int update(hash set, hash cond, hash<auto> opt);
2942 
2943 
2945  int update(hash set, hash cond);
2946 
2947 
2949  int update(hash set);
2950 
2951 
2953 
2971  hash<SqlResultInfo> updateWithInfo(hash<auto> set, hash<auto> cond, *hash<auto> opt);
2972 
2973 
2975 
2987  hash<SqlCommandInfo> getUpdateSql(hash<auto> set, *hash<auto> cond);
2988 
2989 
2991  deprecated int updateNoCommit(hash set, *hash cond, *reference<string> sql);
2992 
2994  deprecated int updateNoCommit(hash set, *hash cond, *hash<auto> opt);
2995 
2996 protected:
2997  int updateIntern(hash<auto> set, *hash<auto> cond, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
2998 public:
2999 
3000 
3001 protected:
3002  string getUpdateExpression(string col, hash<UpdateOperatorInfo> uh);
3003 public:
3004 
3005 
3006 protected:
3007  bool emptyDataIntern();
3008 public:
3009 
3010 
3011 protected:
3012  Columns checkUpsertRow(hash<auto> row, reference<int> upsert_strategy);
3013 public:
3014 
3015 
3016 protected:
3017  code getUpsertInsertFirst(Columns cols, hash example_row, *hash<auto> opt);
3018 public:
3019 
3020 
3021 protected:
3022  code getUpsertUpdateFirst(Columns cols, hash example_row, *hash<auto> opt);
3023 public:
3024 
3025 
3026 protected:
3027  code getUpsertSelectFirst(Columns cols, hash example_row, *hash<auto> opt);
3028 public:
3029 
3030 
3031 protected:
3032  code getUpsertInsertOnly(Columns cols, hash example_row, *hash<auto> opt);
3033 public:
3034 
3035 
3036 protected:
3037  code getUpsertUpdateOnly(Columns cols, hash example_row, *hash<auto> opt);
3038 public:
3039 
3040 
3041 protected:
3042  Columns getUpsertColumns(reference<string> csrc);
3043 public:
3044 
3045 
3046 protected:
3047  string getUpsertSelectSql(hash<auto> row, Columns cols, reference<list<string>> updc);
3048 public:
3049 
3050 
3051 protected:
3052  string getUpsertInsertSql(hash<auto> row);
3053 public:
3054 
3055 
3056 protected:
3057  string getUpsertUpdateSql(hash<auto> row, Columns cols, reference updc, *hash<auto> opt);
3058 public:
3059 
3060 
3061 protected:
3062  softbool tryUpdate(string sql, hash<auto> row, Columns cols, list updc);
3063 public:
3064 
3065 
3066 protected:
3067  checkValue(string cname, string argname, reference val, string type);
3068 public:
3069 
3070 
3072 
3081  string getSqlFromList(list<auto> l);
3082 
3083 
3085 
3096  string getSqlValue(auto v);
3097 
3098 
3100  string getName();
3101 
3102 
3104 
3111  cache(*hash<auto> opts);
3112 
3113 
3115 
3121 
3122 
3124 
3132 
3133 
3135 
3144 
3145 
3147 
3157 
3158 
3159  *AbstractUniqueConstraint findUniqueConstraintUnlocked(string name);
3160 
3161 
3163 
3173 
3174 
3177 
3178 
3181 
3182 
3184 
3194 
3195 
3197 
3219  string getRenameSql(string new_name, *hash<auto> opt);
3220 
3221 
3223 
3232  string getCreateSqlString(*hash<auto> opt);
3233 
3234 
3236 
3245  list<auto> getCreateSql(*hash<auto> opt);
3246 
3247 
3249 
3260  string getCreateTableSql(*hash<auto> opt);
3261 
3262 
3264 
3269 
3270 
3271 protected:
3272  *hash<string, bool> getCheckOmissionOptions(*softlist<softstring> ol, string err);
3273 public:
3274 
3275 
3277 
3292  list<auto> getAlignSql(AbstractTable t, *hash<auto> opt);
3293 
3294 
3295 protected:
3296  list<auto> getAlignSqlUnlocked(AbstractTable t, *hash<auto> opt);
3297 public:
3298 
3299 
3300 protected:
3301  *AbstractColumnSupportingConstraint getSupportingConstraint(string ixname);
3302 public:
3303 
3304 
3305 protected:
3306  renameIndexUnlocked(AbstractIndex ix, string new_name);
3307 public:
3308 
3309 
3311 
3324  string getAlignSqlString(AbstractTable t, *hash<auto> opt);
3325 
3326 
3328 
3340  *list<auto> getCreateIndexesSql(*hash<auto> opt, bool cache = True);
3341 
3342 
3344 
3356  *string getCreatePrimaryKeySql(*hash<auto> opt, bool cache = True);
3357 
3358 
3360 
3372  *list<auto> getCreateForeignConstraintsSql(*hash<auto> opt, bool cache = True);
3373 
3374 
3376 
3390  *list<auto> getCreateConstraintsSql(*hash<auto> opt, bool cache = True);
3391 
3392 
3394 
3406  *list<auto> getCreateMiscSql(*hash<auto> opt, bool cache = True);
3407 
3408 
3410 
3424  *list<auto> getCreateTriggersSql(*hash<auto> opt, bool cache = True);
3425 
3426 
3428 
3435  *hash find(auto id);
3436 
3437 
3439 
3450  *list find(list<auto> ids);
3451 
3452 
3453 protected:
3454  string getPrimaryKeyColumn();
3455 public:
3456 
3457 
3459 
3472  *hash<auto> find(hash<auto> row);
3473 
3474 
3476 
3489  *hash<auto> findSingle(*hash<auto> cond);
3490 
3491 
3493 
3506  *list<auto> findAll(*hash<auto> cond);
3507 
3508 
3510 
3514  string getDesc();
3515 
3516 
3518  string getBaseType();
3519 
3520 
3522  string getSqlName();
3523 
3524 
3526  string getColumnSqlName(string col);
3527 
3528 
3530  list<auto> getColumnSqlNames(softlist cols);
3531 
3532 
3534 
3537 
3538 
3540 
3544  *hash<string, AbstractDataField> getRecordType();
3545 
3546 
3548 
3557  AbstractDataField getColumnDataField(string column_name, *hash<auto> options, *string append_desc);
3558 
3559 
3561 
3569  AbstractDataField getColumnDataField(AbstractColumn column, *hash<SqlUtilDataTypeOptionInfo> options, *string append_desc);
3570 
3571 
3573 
3581  AbstractDataProviderType getColumnDataType(string column_name, *hash<SqlUtilDataTypeOptionInfo> options);
3582 
3583 
3585 
3587  AbstractDataProviderType getDbType(string native_type, *string qore_type, bool nullable, int max_size = -1, *hash<SqlUtilDataTypeOptionInfo> options);
3588 
3589 
3591 
3593  AbstractDataProviderType getNumericType(string type_name, bool nullable, *hash<auto> options);
3594 
3595 
3597 
3602 
3603 
3605  abstract bool hasArrayBind();
3606 
3608 
3610 protected:
3611  hash<auto> getTableOptions();
3612 public:
3613 
3614 
3616 
3618 protected:
3620 public:
3621 
3622 
3624 
3626 protected:
3627  hash<auto> getConstraintOptions();
3628 public:
3629 
3630 
3632 
3634 protected:
3635  hash<auto> getCacheOptions();
3636 public:
3637 
3638 
3640 
3642 protected:
3644 public:
3645 
3646 
3648 
3650 protected:
3651  hash<auto> getAlignTableOptions();
3652 public:
3653 
3654 
3656 
3658 protected:
3660 public:
3661 
3662 
3664 
3666 protected:
3667  hash<auto> getColumnOptions();
3668 public:
3669 
3670 
3672 
3674 protected:
3675  hash<auto> getColumnDescOptions();
3676 public:
3677 
3678 
3680 
3682 protected:
3684 public:
3685 
3686 
3688 
3690 protected:
3691  hash<auto> getIndexOptions();
3692 public:
3693 
3694 
3696 
3698 protected:
3699  hash<auto> getTriggerOptions();
3700 public:
3701 
3702 
3704 
3706 protected:
3707  hash<auto> getSelectOptions();
3708 public:
3709 
3710 
3712 
3714 protected:
3715  hash<auto> getUpsertOptions();
3716 public:
3717 
3718 
3720 
3722 protected:
3723  hash<auto> getInsertOptions();
3724 public:
3725 
3726 
3728 
3730 protected:
3732 public:
3733 
3734 
3736 
3738 protected:
3740 public:
3741 
3742 
3744 
3746 protected:
3747  hash<auto> getWhereOperatorMap();
3748 public:
3749 
3750 
3752 
3754 protected:
3755  hash<auto> getColumnOperatorMap();
3756 public:
3757 
3758 
3760 protected:
3762 public:
3763 
3764 
3766 
3802  addCustomCopOperator(string name, hash<auto> operator);
3803 
3804 
3806 
3808 protected:
3809  hash<auto> getInsertOperatorMap();
3810 public:
3811 
3812 
3814 
3816 protected:
3817  hash<auto> getUpdateOperatorMap();
3818 public:
3819 
3820 
3822 
3824 protected:
3826 public:
3827 
3828 
3830 
3832 protected:
3833  *hash<auto> getPseudoColumnHash();
3834 public:
3835 
3836 
3837 protected:
3838  string getCreateTableSqlUnlocked(*hash<auto> opt);
3839 public:
3840 
3841 
3842 protected:
3843  *list<auto> getCreateIndexesSqlUnlocked(*hash<auto> opt, bool cache = True);
3844 public:
3845 
3846 
3847 protected:
3848  *string getCreatePrimaryKeySqlUnlocked(*hash<auto> opt, bool cache = True);
3849 public:
3850 
3851 
3852 protected:
3853  *list<auto> getCreateConstraintsSqlUnlocked(*hash<auto> opt, bool cache = True);
3854 public:
3855 
3856 
3857 protected:
3858  *list<auto> getCreateForeignConstraintsSqlUnlocked(*hash<auto> opt, bool cache = True);
3859 public:
3860 
3861 
3862 protected:
3863  *list<auto> getCreateMiscSqlUnlocked(*hash<auto> opt, bool cache = True);
3864 public:
3865 
3866 
3867 protected:
3868  *list<auto> getCreateTriggersSqlUnlocked(*hash<auto> opt, bool cache = True);
3869 public:
3870 
3871 
3872 protected:
3873  list<auto> getCreateSqlUnlocked(*hash<auto> opt, bool cache = True);
3874 public:
3875 
3876 
3877 protected:
3878  cacheUnlocked(*hash<auto> opt);
3879 public:
3880 
3881 
3882 protected:
3883  auto execData(*hash<auto> opt, string sql, *list<auto> args);
3884 public:
3885 
3886 
3887 protected:
3888  execData(AbstractSQLStatement stmt, *hash<auto> opt, *list<auto> args);
3889 public:
3890 
3891 
3892  static AbstractTable getTable(AbstractDatasource nds, string nname, *hash<auto> opts);
3893 
3894  static AbstractTable getTable(string dsstr, string nname, *hash<auto> opts);
3895 
3896  static AbstractTable getTable(hash<auto> dsh, string nname, *hash<auto> opts);
3897 
3898 protected:
3899  getColumnsUnlocked();
3900 public:
3901 
3902 
3903 protected:
3904  getPrimaryKeyUnlocked();
3905 public:
3906 
3907 
3908  // also loads primary key and constraints (for unique constraints)
3909 protected:
3910  getIndexesUnlocked();
3911 public:
3912 
3913 
3914 protected:
3915  getForeignConstraintsUnlocked(*hash<auto> opt);
3916 public:
3917 
3918 
3919 protected:
3920  addSourceConstraint(string table_name, AbstractForeignConstraint fk);
3921 public:
3922 
3923 
3924 protected:
3925  getConstraintsUnlocked();
3926 public:
3927 
3928 
3929 protected:
3930  getTriggersUnlocked();
3931 public:
3932 
3933 
3935 protected:
3937 public:
3938 
3939 
3940 protected:
3941  softlist<auto> getDropSqlImpl();
3942 public:
3943 
3944 
3945 protected:
3946  string getTruncateSqlImpl();
3947 public:
3948 
3949 
3951 protected:
3952  auto tryExecArgsImpl(string sql, *softlist<auto> args);
3953 public:
3954 
3955 
3957 protected:
3958  auto tryExecRawImpl(string sql);
3959 public:
3960 
3961 
3963 protected:
3965 public:
3966 
3967 
3968 protected:
3969  preSetupTableImpl(reference desc, *hash<auto> opt);
3970 public:
3971 
3972 
3974 
3976 protected:
3977  abstract AbstractDataProviderType getNumericTypeImpl(string type_name, bool nullable, *hash<auto> options);
3978 public:
3979 
3980 protected:
3981  abstract *hash<auto> doReturningImpl(hash<auto> opt, reference<string> sql, list<auto> args);
3982 public:
3983 
3984 protected:
3985  abstract bool emptyImpl();
3986 public:
3987 
3989 protected:
3990  abstract *string getSqlValueImpl(auto v);
3991 public:
3992 
3994 
3997 protected:
3998  abstract bool checkExistenceImpl();
3999 public:
4000 
4002 protected:
4003  abstract bool supportsTablespacesImpl();
4004 public:
4005 
4007 protected:
4009 public:
4010 
4012 protected:
4014 public:
4015 
4016 protected:
4017  abstract setupTableImpl(hash<auto> desc, *hash<auto> opt);
4018 public:
4019 
4020 protected:
4021  abstract Columns describeImpl();
4022 public:
4023 protected:
4024  abstract AbstractPrimaryKey getPrimaryKeyImpl();
4025 public:
4026 protected:
4027  abstract Indexes getIndexesImpl();
4028 public:
4029 protected:
4030  abstract ForeignConstraints getForeignConstraintsImpl(*hash<auto> opt);
4031 public:
4032 protected:
4033  abstract Constraints getConstraintsImpl();
4034 public:
4035 protected:
4036  abstract Triggers getTriggersImpl();
4037 public:
4038 
4039 protected:
4040  abstract string getCreateTableSqlImpl(*hash<auto> opt);
4041 public:
4042 protected:
4043  abstract *list<auto> getCreateMiscSqlImpl(*hash<auto> opt, bool cache);
4044 public:
4045 protected:
4046  abstract string getCreateSqlImpl(list<auto> l);
4047 public:
4048 protected:
4049  abstract string getRenameSqlImpl(string new_name);
4050 public:
4051 protected:
4052  abstract *list<auto> getAlignSqlImpl(AbstractTable t, *hash<auto> opt);
4053 public:
4054 
4055 protected:
4056  abstract AbstractColumn addColumnImpl(string cname, hash<auto> opt, bool nullable = True);
4057 public:
4058 protected:
4059  abstract AbstractPrimaryKey addPrimaryKeyImpl(string cname, hash<auto> ch, *hash<auto> opt);
4060 public:
4061 protected:
4062  abstract AbstractIndex addIndexImpl(string iname, bool enabled, hash<auto> ch, *hash<auto> opt);
4063 public:
4064 protected:
4065  abstract AbstractForeignConstraint addForeignConstraintImpl(string cname, hash<auto> ch, string table, hash<auto> tch, *hash<auto> opt);
4066 public:
4067 protected:
4068  abstract AbstractCheckConstraint addCheckConstraintImpl(string cname, string src, *hash<auto> opt);
4069 public:
4070 protected:
4071  abstract AbstractUniqueConstraint addUniqueConstraintImpl(string cname, hash<auto> ch, *hash<auto> opt);
4072 public:
4073 
4074 protected:
4075  abstract AbstractTrigger addTriggerImpl(string tname, string src, *hash<auto> opt);
4076 public:
4077 
4079 protected:
4080  abstract bool tryInsertImpl(string sql, hash<auto> row);
4081 public:
4082 
4084 protected:
4085  abstract hash<auto> getQoreTypeMapImpl();
4086 public:
4087 
4089 protected:
4090  abstract hash<auto> getTypeMapImpl();
4091 public:
4092 
4094 protected:
4095  abstract doSelectOrderByWithOffsetSqlUnlockedImpl(reference<string> sql, reference<list<auto>> args, *hash<auto> qh, *hash<auto> jch, *hash<auto> ch, *hash<auto> psch, list coll);
4096 public:
4097 
4099 protected:
4100  abstract doSelectLimitOnlyUnlockedImpl(reference<string> sql, reference<list<auto>> args, *hash<auto> qh);
4101 public:
4102 
4104 protected:
4105  abstract copyImpl(AbstractTable old);
4106 public:
4107 
4109 
4113 protected:
4115 public:
4116 };
4117 };
SqlUtil::AbstractTable::TableOptions
const TableOptions
table options
Definition: AbstractTable.qc.dox.h:44
SqlUtil::AbstractTable::insertFromSelectCommit
int insertFromSelectCommit(list cols, AbstractTable source, hash< auto > sh, reference< string > sql)
SqlUtil::AbstractTable::insertFromSelectCommit() variant
SqlUtil::AbstractTable::renameIndex
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 ...
SqlUtil::AbstractTable::getSqlName
string getSqlName()
returns the name of the table to be used in SQL (with a possible qualifier for schema,...
SqlUtil::AbstractTable::upsertFromIteratorNoCommit
deprecated *hash upsertFromIteratorNoCommit(Qore::AbstractIterator i, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
A legacy SqlUtik::AbstractTable::upsertFromIterator() wrapper.
SqlUtil::AbstractTable::insertCommit
*hash< auto > insertCommit(hash< auto > row, reference< string > sql)
SqlUtil::AbstractTable::insertCommit() variant
SqlUtil::AbstractTable::constraints
Constraints constraints
constraint descriptions
Definition: AbstractTable.qc.dox.h:307
SqlUtil::AbstractTable::tryExecArgs
auto tryExecArgs(string sql, *softlist< auto > args)
executes some SQL with optional arguments so that if an error occurs the current transaction state is...
SqlUtil::AbstractTable::getCreateTableSql
string getCreateTableSql(*hash< auto > opt)
returns an SQL string that could be used to create the basic table structure without indexes and cons...
SqlUtil::AbstractTable::getNumericType
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...
SqlUtil::AbstractTable::getSqlDataCallbackOptions
hash< auto > getSqlDataCallbackOptions()
returns the sql data operation callback options for this driver
SqlUtil::AbstractTable::create
create(*hash< auto > opt)
creates the table with all associated properties (indexes, constraints, etc) without any transaction ...
SqlUtil::AbstractTable::getStatementNoExec
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...
SqlUtil::AbstractTable::del
int del(hash cond, reference< string > sql)
SqlUtil::AbstractTable::del() variant
SqlUtil::AbstractTable::selectRows
*list selectRows(*hash< auto > sh, *hash< auto > opt)
returns a list of hashes representing the rows in the table that match the argument hash
SqlUtil::AbstractTable::addUniqueConstraint
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,...
SqlUtil::AbstractTable::manual
bool manual
manual edits
Definition: AbstractTable.qc.dox.h:315
SqlUtil::AbstractTable::getPrimaryKey
AbstractPrimaryKey getPrimaryKey()
returns an object of class AbstractPrimaryKey describing the primary key of the table
SqlUtil::AbstractTable::inDb
bool inDb
in database
Definition: AbstractTable.qc.dox.h:313
SqlUtil::AbstractTable::findAll
*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...
SqlUtil::AbstractTable::asteriskRequiresPrefix
bool asteriskRequiresPrefix()
returns True if the database requires a wildcard "*" to be prefixed with the table name when it appea...
SqlUtil::AbstractTable::update
int update(hash set, hash cond, hash< auto > opt)
A SqlUtil::AbstractTable::update() variant.
SqlUtil::AbstractTable::clearImpl
clearImpl()
clears any driver-specific table information
SqlUtil::AbstractTable::UpsertSelectFirst
const UpsertSelectFirst
Upsert option: select first, if the row is unchanged, do nothing, if it doesn't exist,...
Definition: AbstractTable.qc.dox.h:223
SqlUtil::AbstractTable::getInsertOperatorMap
hash< auto > getInsertOperatorMap()
returns the insert operator map for this object
SqlUtil::AbstractTable::getUpdateSql
hash< SqlCommandInfo > getUpdateSql(hash< auto > set, *hash< auto > cond)
Returns the SQL for the given update parameters.
SqlUtil::AbstractTable::getUpsertClosure
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...
SqlUtil::AbstractTable::getCreateTriggersSql
*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 ...
SqlUtil::AbstractTrigger
the base class for triggers
Definition: SqlUtil.qm.dox.h:6007
SqlUtil::AbstractUniqueConstraint
represents a unique column constraint
Definition: SqlUtil.qm.dox.h:5723
SqlUtil::ForeignConstraints
foreign constraint container class that throws an exception if an unknown constraint is accessed
Definition: SqlUtil.qm.dox.h:5743
SqlUtil::AbstractTable::getRowIterator
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...
SqlUtil::AbstractTable::UR_Verified
const UR_Verified
row was updated unconditionally (not returned with UpsertSelectFirst)
Definition: AbstractTable.qc.dox.h:267
SqlUtil::AbstractTable::insert
*hash< auto > insert(hash< auto > row, hash< auto > opt)
SqlUtil::AbstractTable::insert() variant
SqlUtil::AbstractTable::setDatasource
setDatasource(AbstractDatasource nds)
changes the datasource for the table; if the inDb flag is True, then it is set to False by calling th...
SqlUtil::AbstractTable::dropPrimaryKey
AbstractPrimaryKey dropPrimaryKey(*reference lsql)
drops the primary key from the table; if the table is known to be in the database already,...
SqlUtil::AbstractTable::primaryKey
AbstractPrimaryKey primaryKey
primary key description
Definition: AbstractTable.qc.dox.h:301
type
string type(auto arg)
SqlUtil::AbstractTable::getAddIndexSql
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
SqlUtil::AbstractTable::triggers
Triggers triggers
trigger descriptions
Definition: AbstractTable.qc.dox.h:309
SqlUtil::AbstractTable::constraintsLinkedToIndexesImpl
abstract bool constraintsLinkedToIndexesImpl()
returns True if the database links constraints to indexes (ie dropping the constraint drops the index...
SqlUtil::AbstractTable::truncate
truncate()
truncates all the table data without any transaction management
SqlUtil::AbstractTable::delWithInfo
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...
SqlUtil::AbstractTable::insertCommit
*hash< auto > insertCommit(hash< auto > row, hash< auto > opt)
SqlUtil::AbstractTable::insertCommit() variant
SqlUtil::AbstractTable::InsertOptions
const InsertOptions
generic SQL insert options
Definition: AbstractTable.qc.dox.h:164
SqlUtil::AbstractTable::uniqueIndexCreatesConstraintImpl
abstract bool uniqueIndexCreatesConstraintImpl()
returns True if the database automatically creates a unique constraint when a unique index is created...
SqlUtil::AbstractTable::updateNoCommit
deprecated int updateNoCommit(hash set, *hash cond, *reference< string > sql)
A legacy SqlUtil::AbstractTable::update() wrapper.
SqlUtil::AbstractTable::dropIndex
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,...
SqlUtil::AbstractTable::del
int del()
SqlUtil::AbstractTable::del() variant
SqlUtil::AbstractTable::TriggerOptions
const TriggerOptions
default trigger options
Definition: AbstractTable.qc.dox.h:74
SqlUtil::AbstractTable::getSubtableFromString
AbstractTable getSubtableFromString(string table, *hash< auto > opt)
Returns the given table from the argument, using any "tablecode" option if present.
SqlUtil::AbstractTable::rollback
rollback()
rolls back the current transaction on the underlying Qore::SQL::AbstractDatasource
SqlUtil::AbstractTable::UpsertResultMap
const UpsertResultMap
hash mapping upsert results to a description
Definition: AbstractTable.qc.dox.h:282
SqlUtil::AbstractTable::getDropConstraintSql
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 ...
SqlUtil::AbstractTable::insertNoCommit
deprecated *hash< auto > insertNoCommit(hash< auto > row, *reference< string > sql, *hash< auto > opt)
A legacy wrapper for SqlUtil::AbstractTable::insert()
SqlUtil::AbstractTable::copyImpl
abstract copyImpl(AbstractTable old)
db-specific copy actions
SqlUtil::AbstractTable::addPrimaryKey
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,...
Qore::SQL::SQLStatement
SqlUtil::AbstractTable::find
*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...
SqlUtil::AbstractTable::tryExecRaw
auto tryExecRaw(string sql)
executes some SQL so that if an error occurs the current transaction state is not lost
SqlUtil::AbstractTable::ColumnDescOptions
const ColumnDescOptions
Column description options.
Definition: AbstractTable.qc.dox.h:133
SqlUtil::AbstractTable::update
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...
SqlUtil::AbstractTable::columns
Columns columns
column description object
Definition: AbstractTable.qc.dox.h:299
SqlUtil::AbstractTable::getCreateConstraintsSql
*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...
SqlUtil::AbstractTable::insert
*hash< auto > insert(hash< auto > row, reference< string > sql)
SqlUtil::AbstractTable::insert() variant
SqlUtil::AbstractTable::insertFromSelectCommit
int insertFromSelectCommit(list cols, AbstractTable source)
SqlUtil::AbstractTable::insertFromSelectCommit() variant
SqlUtil::AbstractTable::select
*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
SqlUtil::AbstractTable::inDb
bool inDb()
returns True if the table has been read from or created in the database, False if not
SqlUtil::AbstractTable::addIndex
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 ...
SqlUtil::AbstractTable::insertFromIteratorNoCommit
deprecated int insertFromIteratorNoCommit(Qore::AbstractIterator i, *hash< auto > opt)
A legacy SqlUtil::AbstractTable::insertFromIterator() wrapper.
SqlUtil::AbstractTable::getRowIterator
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...
SqlUtil::AbstractTable::insertFromSelect
int insertFromSelect(list cols, AbstractTable source)
SqlUtil::AbstractTable::insertFromSelectCommit() variant
SqlUtil::AbstractTable::findUniqueConstraint
*AbstractUniqueConstraint findUniqueConstraint(string name)
returns the given AbstractUniqueConstraint object if defined for the table (also includes the primary...
SqlUtil::AbstractTable::TableCreationOptions
const TableCreationOptions
table creation options
Definition: AbstractTable.qc.dox.h:90
SqlUtil::AbstractTable::insertFromSelectCommit
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...
SqlUtil::AbstractTable::UpsertInsertFirst
const UpsertInsertFirst
Upsert option: insert first, if the insert fails, then update.
Definition: AbstractTable.qc.dox.h:206
SqlUtil::AbstractTable::SqlDataCallbackOptions
const SqlDataCallbackOptions
generic SQL data operation callbacks
Definition: AbstractTable.qc.dox.h:151
SqlUtil::AbstractTable::tryExecArgsImpl
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
SqlUtil::AbstractTable::updateWithInfo
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...
SqlUtil::AbstractTable::checkExistenceImpl
abstract bool checkExistenceImpl()
returns True if the table exists in the DB, False if not
SqlUtil::AbstractSqlUtilBase
base class for abstract SqlUtil classes
Definition: AbstractSqlUtilBase.qc.dox.h:34
SqlUtil::AbstractTable::bindEmptyStringsAsNull
bool bindEmptyStringsAsNull()
returns True if the DB treats empty strings as NULL, False if not; by default this method returns Fal...
SqlUtil::AbstractTable::copy
copy(AbstractTable old)
copies the object
SqlUtil::AbstractTable::tryInsertImpl
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,...
SqlUtil::AbstractTable::dropForeignConstraint
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,...
SqlUtil::AbstractTable::updateCommit
int updateCommit(hash set, hash cond, hash< auto > opt)
A SqlUtil::AbstractTable::updateCommit() variant.
SqlUtil::AbstractTable::insertFromSelect
int insertFromSelect(list cols, AbstractTable source, hash< auto > sh)
SqlUtil::AbstractTable::insertFromSelectCommit() variant
SqlUtil::AbstractTable::UR_Inserted
const UR_Inserted
row was inserted
Definition: AbstractTable.qc.dox.h:264
SqlUtil::AbstractTable::rowCount
softint rowCount()
returns the number of rows in the table
SqlUtil::AbstractTable::updateCommit
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...
SqlUtil::AbstractForeignConstraint
the base class for foreign key constraint information
Definition: SqlUtil.qm.dox.h:5809
SqlUtil::AbstractTable::find
*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...
SqlUtil::AbstractTable::insert
*hash< auto > insert(hash< auto > row)
inserts a row into the table without any transaction management; a transaction will be in progress af...
SqlUtil::AbstractTable::UR_Deleted
const UR_Deleted
row was deleted (only possible with batch upsert methods such as AbstractTable::upsertFromIterator() ...
Definition: AbstractTable.qc.dox.h:276
SqlUtil::AbstractTable::TableDescriptionHashOptions
const TableDescriptionHashOptions
Table description options.
Definition: AbstractTable.qc.dox.h:117
SqlUtil::AbstractTable::addColumn
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 ...
SqlUtil::AbstractTable::getStatement
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...
SqlUtil::AbstractTable::upsertFromSelectCommit
*hash upsertFromSelectCommit(Table t, *hash< auto > sh, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
SqlUtil::AbstractTable::upsertFromSelectCommit() variant
SqlUtil::AbstractTable::ConstraintOptions
const ConstraintOptions
default constraint options
Definition: AbstractTable.qc.dox.h:58
SqlUtil::AbstractTable::IndexOptions
const IndexOptions
default index options
Definition: AbstractTable.qc.dox.h:52
SqlUtil::AbstractTable::setupTable
setupTable(hash< auto > desc, *hash< auto > opt)
creates the object from a table description hash
True
const True
SqlUtil::AbstractTable::getRecordType
*hash< string, AbstractDataField > getRecordType()
returns a record description for the table
SqlUtil::AbstractTable::createNoCommit
deprecated createNoCommit(*hash< auto > opt)
A legacy wrapper for create()
SqlUtil::AbstractTable::upsertFromSelectNoCommit
deprecated *hash upsertFromSelectNoCommit(Table t, *hash< auto > sh, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
A legacy SqlUtil::AbstractTable::upsertFromSelect() wrapper.
SqlUtil::Table
represents a database table; this class embeds an AbstractTable object that is created automatically ...
Definition: Table.qc.dox.h:50
SqlUtil::AbstractTable::getSqlFromList
string getSqlFromList(list< auto > l)
returns an SQL string corresponding to the list of commands in the argument
SqlUtil::AbstractTable::selectRow
*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...
SqlUtil::AbstractTable::removeForeignConstraint
AbstractForeignConstraint removeForeignConstraint(string cname)
removes the named foreign constraint from the table; no SQL is executed in any case,...
SqlUtil::AbstractTable::delCommit
int delCommit(hash cond, reference< string > sql)
SqlUtil::AbstractTable::delCommit() variant
SqlUtil::AbstractTable::getDropTriggerSql
list< auto > getDropTriggerSql(string tname, *hash< auto > opt)
returns SQL that can be used to drop the given trigger from the table
SqlUtil::AbstractTable::getCacheOptions
hash< auto > getCacheOptions()
returns the cache options for this driver
SqlUtil::AbstractTable::UpsertStrategyMap
const UpsertStrategyMap
hash mapping upsert strategy codes to a text description
Definition: AbstractTable.qc.dox.h:249
SqlUtil::AbstractTable::getAddUniqueConstraintSql
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
SqlUtil::AbstractTable::findSingle
*hash< auto > findSingle(*hash< auto > cond)
finds a single row in the table that match the row condition passed; multiple rows may match,...
SqlUtil::AbstractTable::getForeignConstraintOptions
hash< auto > getForeignConstraintOptions()
return the foreign constraint options for this driver
SqlUtil::AbstractTable::update
int update(hash set, hash cond)
A SqlUtil::AbstractTable::update() variant.
SqlUtil::AbstractTable::UpsertAuto
const UpsertAuto
Upsert option: if the target table is empty, use UpsertInsertFirst, otherwise use UpsertUpdateFirst.
Definition: AbstractTable.qc.dox.h:230
SqlUtil::AbstractTable::cache
cache(*hash< auto > opts)
reads in all attributes of the table from the database
SqlUtil::AbstractTable::getIndexOptions
hash< auto > getIndexOptions()
returns the index options for this driver
SqlUtil::AbstractTable::UR_Unchanged
const UR_Unchanged
row was unchanged (only possible with UpsertSelectFirst, UpsertInsertOnly, and UpsertUpdateOnly)
Definition: AbstractTable.qc.dox.h:273
SqlUtil::AbstractTable::doSelectLimitOnlyUnlockedImpl
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,...
SqlUtil::AbstractTable::renameColumn
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...
SqlUtil::AbstractTable::getIndexes
Indexes getIndexes()
returns an object of class Indexes describing the indexes on the table
SqlUtil::AbstractTable::update
int update(hash set, hash cond, reference< string > sql)
A SqlUtil::AbstractTable::update() variant.
SqlUtil::AbstractTable::getName
string getName()
returns the name of the table
SqlUtil::AbstractTable::getInsertFromIteratorOptions
hash< auto > getInsertFromIteratorOptions()
returns the insert from iterator options for this driver
SqlUtil::AbstractTable::hasReturning
bool hasReturning()
returns True if the current database driver supports the "returning" clause in insert statements,...
SqlUtil::AbstractTable::supportsTablespacesImpl
abstract bool supportsTablespacesImpl()
returns True if the database support tablespaces
SqlUtil::AbstractTable::AdditionalColumnDescOptions
const AdditionalColumnDescOptions
additional column description keys valid when describing columns in a table description hash
Definition: AbstractTable.qc.dox.h:140
SqlUtil::AbstractTable::upsertFromSelect
deprecated *hash upsertFromSelect(Table t, *hash< auto > sh, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
SqlUtil::AbstractTable::upsertFromSelect() variant
SqlUtil::AbstractSqlUtilBase::opts
*hash< auto > opts
option hash
Definition: AbstractSqlUtilBase.qc.dox.h:41
SqlUtil::AbstractTable::upsertFromSelectNoCommit
deprecated *hash upsertFromSelectNoCommit(AbstractTable t, *hash< auto > sh, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
A legacy SqlUtil::AbstractTable::upsertFromSelect() wrapper.
SqlUtil::AbstractTable::selectRow
*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...
SqlUtil::AbstractColumn
the base class for column information
Definition: SqlUtil.qm.dox.h:5264
SqlUtil::AbstractTable::getUpsertOptions
hash< auto > getUpsertOptions()
returns the upsert options for this driver
SqlUtil::AbstractTable::UpsertResultLetterMap
const UpsertResultLetterMap
maps upsert result codes to single letter symbols
Definition: AbstractTable.qc.dox.h:292
SqlUtil::AbstractIndex
the abstract base class for index information
Definition: SqlUtil.qm.dox.h:5439
SqlUtil::AbstractTable::upsertNoCommit
deprecated int upsertNoCommit(hash< auto > row, int upsert_strategy=UpsertAuto)
A legacy SqlUtil::AbstractTable::upsert() wrapper.
SqlUtil::AbstractTable::getTableDescriptionHashOptions
hash< auto > getTableDescriptionHashOptions()
returns the table description hash<auto> options for this driver
SqlUtil::AbstractTable::getDropColumnSql
list< auto > getDropColumnSql(string cname, *hash< auto > opt)
returns the SQL that can be used to drop a column from the table
SqlUtil::AbstractTable::insertFromSelectCommit
int insertFromSelectCommit(list cols, AbstractTable source, hash< auto > sh, hash< auto > opt)
SqlUtil::AbstractTable::insertFromSelectCommit() variant
SqlUtil::AbstractTable::upsertFromIteratorCommit
*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...
SqlUtil::AbstractSavepointHelper
Abstract base class for savepoint helpers for epheremal transaction support.
Definition: AbstractSavepointHelper.qc.dox.h:33
SqlUtil::AbstractTable::TableOmissionOptions
const TableOmissionOptions
alignment omission options
Definition: AbstractTable.qc.dox.h:83
SqlUtil::AbstractTable::getTruncateSql
string getTruncateSql(*hash< auto > opt)
gets the SQL that can be used to truncate the table
SqlUtil::AbstractTable::UpsertStrategyDescriptionMap
const UpsertStrategyDescriptionMap
hash mapping upsert strategy descriptions to upsert strategy codes
Definition: AbstractTable.qc.dox.h:255
SqlUtil::AbstractTable::insertFromSelectWithInfo
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...
SqlUtil::AbstractTable::getDropConstraintIfExistsSql
*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...
SqlUtil::AbstractTable::delNoCommit
deprecated int delNoCommit(*hash cond, *reference< string > sql)
A legacy SqlUtil::AbstractTable::del() wrapper.
SqlUtil::AbstractTable::upsertCommit
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...
SqlUtil::AbstractTable::UR_Updated
const UR_Updated
row was updated because it was different (only possible with UpsertSelectFirst)
Definition: AbstractTable.qc.dox.h:270
SqlUtil::AbstractTable::getColumnDataField
AbstractDataField getColumnDataField(string column_name, *hash< auto > options, *string append_desc)
returns a field object for the given column
SqlUtil::AbstractTable::rename
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,...
SqlUtil::AbstractTable::UpsertInsertOnly
const UpsertInsertOnly
Upsert option: insert if the row does not exist, otherwise ignore.
Definition: AbstractTable.qc.dox.h:237
SqlUtil::AbstractTable::del
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...
SqlUtil::AbstractTable::getTableOptions
hash< auto > getTableOptions()
returns the table options for this driver
SqlUtil::AbstractTable::getDropPrimaryKeySql
list< auto > getDropPrimaryKeySql(*hash< auto > opt)
gets a list of SQL strings that can be used to drop the primary key from the table
SqlUtil::AbstractTable::getWhereOperatorMap
hash< auto > getWhereOperatorMap()
returns the "where" operator map for this object
SqlUtil::AbstractTable::getPseudoColumnHash
*hash< auto > getPseudoColumnHash()
returns a hash of valid pseudocolumns
SqlUtil::AbstractTable::checkExistence
bool checkExistence()
returns True if the table exists in the database, False if not
SqlUtil::AbstractTable::updateCommit
int updateCommit(hash set, hash cond)
A SqlUtil::AbstractTable::updateCommit() variant.
SqlUtil::AbstractTable::getColumnOptions
hash< auto > getColumnOptions()
returns the column options for this driver
SqlUtil::AbstractCheckConstraint
abstract class for check constraints
Definition: SqlUtil.qm.dox.h:5612
SqlUtil::AbstractTable::createCommit
createCommit(*hash< auto > opt)
creates the table in the database; releases the transaction lock after creating the table
SqlUtil::AbstractTable::ColumnOptions
const ColumnOptions
Column options; this is currently empty and can be extended in database-specific modules.
Definition: AbstractTable.qc.dox.h:144
list
list< auto > list(...)
SqlUtil::AbstractTable::commit
commit()
commits the current transaction on the underlying Qore::SQL::AbstractDatasource
SqlUtil::AbstractTable::getTableColumnDescOptions
hash< auto > getTableColumnDescOptions()
returns the table column description options for this driver
SqlUtil::AbstractTable::getSelectSql
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...
SqlUtil::AbstractTable::insertCommit
*hash< auto > insertCommit(hash< auto > row, reference< string > sql, hash< auto > opt)
SqlUtil::AbstractTable::insertCommit() variant
SqlUtil::AbstractTable::getTableCreationOptions
hash< auto > getTableCreationOptions()
returns the table creation options for this driver
SqlUtil::AbstractTable::SelectOptions
const SelectOptions
default possible select options; can be extended by driver-specific modules
Definition: AbstractTable.qc.dox.h:79
SqlUtil::AbstractTable::insertFromSelect
int insertFromSelect(list cols, AbstractTable source, hash< auto > sh, reference< string > sql)
SqlUtil::AbstractTable::insertFromSelectCommit() variant
SqlUtil::AbstractTable::delCommit
int delCommit(hash cond, hash< auto > opt)
SqlUtil::AbstractTable::delCommit() variant
SqlUtil::AbstractTable::del
int del(hash cond)
SqlUtil::AbstractTable::del() variant
SqlUtil::AbstractTable::dropNoCommit
deprecated dropNoCommit(*hash< auto > opt)
A legacy wrapper for drop()
SqlUtil::AbstractTable::upsertFromIterator
*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...
SqlUtil::AbstractTable::getDropAllConstraintsAndIndexesOnColumnSql
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...
SqlUtil::AbstractTable::getSqlValue
string getSqlValue(auto v)
returns a string for use in SQL queries representing the DB-specific value of the argument
SqlUtil::AbstractTable::updateCommit
int updateCommit(hash set, hash cond, reference< string > sql)
A SqlUtil::AbstractTable::updateCommit() variant.
SqlUtil::Columns
column container class that throws an exception if an unknown column is accessed
Definition: SqlUtil.qm.dox.h:5182
SqlUtil::AbstractTable::truncateNoCommit
deprecated truncateNoCommit()
A legacy warpper for truncate()
SqlUtil::AbstractTable::delCommit
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...
SqlUtil::Indexes
index container class that throws an exception if an unknown index is accessed
Definition: SqlUtil.qm.dox.h:5393
SqlUtil::AbstractTable::getDbType
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
SqlUtil::AbstractTable
the base abstract class for the table implementation
Definition: AbstractTable.qc.dox.h:36
SqlUtil::AbstractTable::delCommit
int delCommit()
SqlUtil::AbstractTable::delCommit() variant
SqlUtil::AbstractTable::dropCommit
dropCommit(*hash< auto > opt)
drops the table from the database; releases the transaction lock after dropping the table
SqlUtil::AbstractTable::UpsertResultDescriptionMap
const UpsertResultDescriptionMap
hash mapping upsert descriptions to codes
Definition: AbstractTable.qc.dox.h:288
SqlUtil::AbstractTable::getColumnDataField
AbstractDataField getColumnDataField(AbstractColumn column, *hash< SqlUtilDataTypeOptionInfo > options, *string append_desc)
returns a field object for the given column
SqlUtil::AbstractTable::getSavepointHelperImpl
abstract AbstractSavepointHelper getSavepointHelperImpl(*string savepoint)
get DB-specific savepoint helper
SqlUtil::AbstractTable::insertFromSelect
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...
SqlUtil::AbstractTable::getTypeMapImpl
abstract hash< auto > getTypeMapImpl()
returns the type name -> type description hash
SqlUtil::AbstractTable::insert
*hash< auto > insert(hash< auto > row, reference< string > sql, hash< auto > opt)
SqlUtil::AbstractTable::insert() variant
SqlUtil::AbstractTable::getInsertOptions
hash< auto > getInsertOptions()
returns the insert options for this driver
SqlUtil::AbstractTable::getRawUpdateOperatorMap
hash< auto > getRawUpdateOperatorMap()
returns the raw (default) update operator map for this object
SqlUtil::AbstractTable::getAddColumnSql
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
SqlUtil::AbstractTable::getAddPrimaryKeySql
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
SqlUtil::AbstractTable::getUniqueConstraintIterator
Qore::AbstractIterator getUniqueConstraintIterator()
returns an iterator for all unique constraints on the table (including the primary key if any)
hash
hash< auto > hash(object obj)
SqlUtil::AbstractTable::dropColumn
AbstractColumn dropColumn(string cname, *reference lsql)
drops a column from the table
SqlUtil::AbstractTable::insertFromSelect
int insertFromSelect(list cols, AbstractTable source, hash< auto > sh, hash< auto > opt)
SqlUtil::AbstractTable::insertFromSelectCommit() variant
SqlUtil::AbstractColumnSupportingConstraint
the API for a constraint with columns
Definition: SqlUtil.qm.dox.h:5638
SqlUtil::AbstractTable::native_case
bool native_case
native case option
Definition: AbstractTable.qc.dox.h:311
SqlUtil::AbstractTable::getCreateSql
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 ...
SqlUtil::AbstractTable::getModifyColumnSql
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
SqlUtil::Triggers
trigger container class that throws an exception if an unknown trigger is accessed
Definition: SqlUtil.qm.dox.h:6025
SqlUtil::AbstractTable::update
int update(hash set)
A SqlUtil::AbstractTable::update() variant.
SqlUtil::AbstractTable::insertFromIteratorCommit
int insertFromIteratorCommit(Qore::AbstractIterator i, *hash< auto > opt)
this method inserts data from the given iterator argument (whose getValue() method must return a hash...
SqlUtil::AbstractTable::getColumnOperatorMap
hash< auto > getColumnOperatorMap()
returns the column operator map for this object
SqlUtil::AbstractTable::updateNoCommit
deprecated int updateNoCommit(hash set, *hash cond, *hash< auto > opt)
A legacy SqlUtil::AbstractTable::update() wrapper.
SqlUtil::AbstractTable::getConstraints
Constraints getConstraints()
returns a Constraints object describing the non-foreign constraints on the table
SqlUtil::AbstractTable::getColumnSqlNames
list< auto > getColumnSqlNames(softlist cols)
returns a list of column names for use in SQL strings; subclasses can process the argument list in ca...
SqlUtil::AbstractTable::getColumnDescOptions
hash< auto > getColumnDescOptions()
returns the column description options for this driver
SqlUtil::AbstractTable::getBulkUpsertClosure
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...
SqlUtil::AbstractTable::getUpsertClosureWithValidation
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...
join
string join(string str,...)
SqlUtil::AbstractTable::tryExec
auto tryExec(string sql)
executes some SQL with optional arguments so that if an error occurs the current transaction state is...
SqlUtil::AbstractTable::selectRows
*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
SqlUtil::AbstractTable::getColumnDataType
AbstractDataProviderType getColumnDataType(string column_name, *hash< SqlUtilDataTypeOptionInfo > options)
returns the data type for the given column
SqlUtil::AbstractTable::InsertFromIteratorOptions
const InsertFromIteratorOptions
default insert option keys
Definition: AbstractTable.qc.dox.h:182
SqlUtil::AbstractTable::hasReturningImpl
bool hasReturningImpl()
returns True if the current database driver supports the "returning" clause in insert statements,...
SqlUtil::AbstractTable::getColumnOperatorMapImpl
*hash< auto > getColumnOperatorMapImpl()
Reimplement in subclasses to provide driver specific column operators.
SqlUtil::AbstractTable::ForeignConstraintOptions
const ForeignConstraintOptions
default foreign constraint options
Definition: AbstractTable.qc.dox.h:68
SqlUtil::AbstractTable::getDropIndexSql
string getDropIndexSql(string iname, *hash< auto > opt)
gets the SQL that can be used to drop an index from the table
SqlUtil::AbstractTable::getConstraintOptions
hash< auto > getConstraintOptions()
returns the constraint options for this driver
SqlUtil::AbstractTable::upsertFromSelect
*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...
SqlUtil::AbstractTable::insertCommit
*hash< auto > insertCommit(hash< auto > row)
inserts a row into the table; the transaction is committed if successful, if an error occurs,...
SqlUtil::AbstractTable::updateCommit
int updateCommit(hash set)
A SqlUtil::AbstractTable::updateCommit() variant.
SqlUtil::AbstractPrimaryKey
represents a primary key
Definition: SqlUtil.qm.dox.h:5732
SqlUtil::AbstractDatabase::CreationOptions
const CreationOptions
default generic creation options
Definition: AbstractDatabase.qc.dox.h:124
False
const False
SqlUtil::AbstractTable::insertFromSelectNoCommit
deprecated int insertFromSelectNoCommit(list cols, AbstractTable source, *hash< auto > sh, *reference< string > sql, *hash< auto > opt)
A legacy SqlUtil::AbstractTable::insertFromSelect() wrapper.
SqlUtil::AbstractTable::drop
drop(*hash< auto > opt)
drops the table from the database without any transaction management
SqlUtil::AbstractTable::addCustomCopOperator
addCustomCopOperator(string name, hash< auto > operator)
register custom user column operator for this table object
SqlUtil::AbstractTable::empty
bool empty()
returns True if the table has no definitions, False if not
SqlUtil::AbstractTable::getStatement
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...
SqlUtil::AbstractTable::validateColumnOptions
validateColumnOptions(string cname, reference< hash > opt, bool nullable)
validates column options
SqlUtil::AbstractTable::getRowIteratorNoExec
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...
SqlUtil::AbstractTable::getCreateMiscSql
*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,...
SqlUtil::AbstractTable::getQoreTypeMapImpl
abstract hash< auto > getQoreTypeMapImpl()
returns the qore type -> column type map
SqlUtil::AbstractTable::UpsertUpdateFirst
const UpsertUpdateFirst
Upsert option: update first, if the update fails, then insert.
Definition: AbstractTable.qc.dox.h:214
SqlUtil::AbstractTable::truncateCommit
truncateCommit()
truncates all the table data; releases the transaction lock after executing
SqlUtil::AbstractTable::insertFromSelectCommit
int insertFromSelectCommit(list cols, AbstractTable source, hash< auto > sh)
SqlUtil::AbstractTable::insertFromSelectCommit() variant
SqlUtil::AbstractTable::getAlignTableOptions
hash< auto > getAlignTableOptions()
returns the align table options for this driver
SqlUtil::AbstractTable::addTrigger
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...
SqlUtil::AbstractTable::getAlignSql
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...
SqlUtil::AbstractTable::addForeignConstraint
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,...
SqlUtil::Constraints
constraint container class that throws an exception if an unknown constraint is accessed
Definition: SqlUtil.qm.dox.h:5508
SqlUtil::AbstractTable::getColumnSqlName
string getColumnSqlName(string col)
returns the column name for use in SQL strings; subclasses can return a special string in case the co...
SqlUtil::AbstractTable::getCreateIndexesSql
*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...
SqlUtil
Qore AbstractDatabase class definition.
Definition: AbstractDatabase.qc.dox.h:32
SqlUtil::AbstractTable::getTriggers
Triggers getTriggers()
returns an object of class Triggers describing the triggers on the table
SqlUtil::AbstractTable::delCommit
int delCommit(hash cond)
SqlUtil::AbstractTable::delCommit() variant
SqlUtil::AbstractTable::selectWithInfo
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...
SqlUtil::AbstractTable::getCreatePrimaryKeySql
*string getCreatePrimaryKeySql(*hash< auto > opt, bool cache=True)
returns an SQL string that could be used to create the primary key on the table
SqlUtil::Tables
the table container class stores a collection of tables in a schema
Definition: SqlUtil.qm.dox.h:4996
SqlUtil::AbstractTable::describe
Columns describe()
returns an object of class Columns describing the table
SqlUtil::AbstractTable::getRenameSql
string getRenameSql(string new_name, *hash< auto > opt)
returns an SQL string that could be used to rename the table in the database
SqlUtil::AbstractTable::upsert
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...
Qore::SQL::AbstractSQLStatement
SqlUtil::AbstractTable::del
int del(hash cond, hash< auto > opt)
SqlUtil::AbstractTable::del() variant
SqlUtil::AbstractTable::constructor
constructor(AbstractDatasource nds, string nname, *hash nopts)
creates the object; private constructor
SqlUtil::AbstractTable::name
string name
the table's name
Definition: AbstractTable.qc.dox.h:297
SqlUtil::AbstractTable::UpsertOptions
const UpsertOptions
default upsert option keys
Definition: AbstractTable.qc.dox.h:174
SqlUtil::AbstractTable::AlignTableOptions
const AlignTableOptions
table alignment options
Definition: AbstractTable.qc.dox.h:102
SqlUtil::AbstractTable::getStatementNoExec
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...
SqlUtil::AbstractTable::insertWithInfo
hash< SqlResultInfo > insertWithInfo(hash< auto > row, *hash< auto > opt)
Inserts a row and returns the result and also the SQL used.
SqlUtil::AbstractTable::getSqlValueImpl
abstract *string getSqlValueImpl(auto v)
returns a string for use in SQL queries representing the DB-specific value of the argument; returns N...
SqlUtil::AbstractTable::renameConstraint
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,...
SqlUtil::AbstractTable::modifyColumn
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,...
SqlUtil::AbstractTable::getDesc
string getDesc()
returns a descriptive string of the datasource (without the password) and the table name (with a poss...
SqlUtil::AbstractTable::find
*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...
SqlUtil::AbstractTable::getTriggerOptions
hash< auto > getTriggerOptions()
returns the trigger options for this driver
SqlUtil::AbstractTable::tryExecRawImpl
auto tryExecRawImpl(string sql)
tries to execute a command so that if an error occurs the current transaction status is not lost
SqlUtil::AbstractTable::UpsertUpdateOnly
const UpsertUpdateOnly
Upsert option: update if the row exists, otherwise ignore.
Definition: AbstractTable.qc.dox.h:244
SqlUtil::AbstractTable::upsertFromSelectCommit
*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...
SqlUtil::AbstractTable::getForeignConstraints
ForeignConstraints getForeignConstraints(*hash< auto > opt)
returns a ForeignConstraints object describing the foreign constraints that the table has on other ta...
SqlUtil::AbstractSqlUtilBase::l
transient Mutex l()
mutex for atomic actions
SqlUtil::AbstractTable::getSavepointHelper
AbstractSavepointHelper getSavepointHelper(*string savepoint)
get DB-specific savepoint helper
Qore::AbstractIterator
SqlUtil::AbstractTable::getUpdateOperatorMap
hash< auto > getUpdateOperatorMap()
returns the update operator map for this object
SqlUtil::AbstractTable::insertFromIterator
int insertFromIterator(Qore::AbstractIterator i, *hash< auto > opt)
this method inserts data from the given iterator argument (whose getValue() method must return a hash...
SqlUtil::AbstractTable::getSelectOptions
hash< auto > getSelectOptions()
returns the select options for this driver
SqlUtil::AbstractTable::getAddCheckConstraintSql
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
SqlUtil::AbstractConstraint
abstract base class for constraints
Definition: SqlUtil.qm.dox.h:5550
SqlUtil::AbstractTable::CacheOptions
const CacheOptions
default cache options
Definition: AbstractTable.qc.dox.h:61
SqlUtil::AbstractTable::foreignConstraints
ForeignConstraints foreignConstraints
foreign constraints description
Definition: AbstractTable.qc.dox.h:305
SqlUtil::AbstractTable::getAddForeignConstraintSql
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
SqlUtil::AbstractTable::doSelectOrderByWithOffsetSqlUnlockedImpl
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
SqlUtil::AbstractTable::dropConstraint
AbstractConstraint dropConstraint(string cname, *reference< string > sql)
drops a constraint from the table; this can be any constraint on the table, a primary key,...
SqlUtil::AbstractTable::getCreateSqlString
string getCreateSqlString(*hash< auto > opt)
returns an SQL string that could be used to create the table and all known properties of the table
SqlUtil::AbstractTable::addCheckConstraint
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,...
SqlUtil::AbstractTable::dropTrigger
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,...
SqlUtil::AbstractTable::getCreateForeignConstraintsSql
*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...
SqlUtil::AbstractTable::getAlignSqlString
string getAlignSqlString(AbstractTable t, *hash< auto > opt)
accepts an AbstractTable argument and returns an SQL string that could be executed to align the struc...
SqlUtil::AbstractTable::getDropSql
softlist< auto > getDropSql(*hash< auto > opt)
returns the sql required to drop the table; reimplement in subclasses if necessary
SqlUtil::AbstractTable::getNumericTypeImpl
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...
SqlUtil::AbstractTable::emptyData
bool emptyData()
returns True if the table has no data rows, False if not
SqlUtil::AbstractTable::getBaseType
string getBaseType()
returns the base type of the underlying object (normally "table", some DB-specific implementations ma...
SqlUtil::AbstractTable::getStatementNoExecWithInfo
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...
SqlUtil::AbstractTable::getAddTriggerSql
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
SqlUtil::AbstractTable::hasArrayBind
abstract bool hasArrayBind()
returns True if the underlying DB driver supports bulk DML operations
SqlUtil::AbstractTable::indexes
Indexes indexes
index descriptions
Definition: AbstractTable.qc.dox.h:303
SqlUtil::AbstractTable::selectRowsWithInfo
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...
SqlUtil::AbstractTable::insertNoCommit
deprecated *hash< auto > insertNoCommit(hash< auto > row, hash< auto > opt)
A legacy wrapper for SqlUtil::AbstractTable::insert()
SqlUtil::AbstractTable::getStatementWithInfo
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...
SqlUtil::AbstractTable::getRenameColumnSql
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
SqlUtil::AbstractTable::selectRowWithInfo
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...
SqlUtil::AbstractTable::clear
clear()
purges the current table definition
SqlUtil::AbstractTable::select
*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