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 
336  copy(AbstractTable old);
337 
338 
340 
351  setDatasource(AbstractDatasource nds);
352 
353 
354 protected:
355  doTableOptions(*hash nopts);
356 public:
357 
358 
360  commit();
361 
362 
364  rollback();
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 
491  truncateCommit();
492 
493 
495 
502  truncate();
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 
947  AbstractPrimaryKey dropPrimaryKey(*reference lsql);
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 
1672  bool hasReturning();
1673 
1674 
1676 
1695  int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh, reference<string> sql, hash<auto> opt);
1696 
1697 
1699  int insertFromSelectCommit(list cols, AbstractTable source);
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 
1738  int insertFromSelect(list cols, AbstractTable source);
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 
1797  int insertFromIteratorCommit(Qore::AbstractIterator i, *hash<auto> opt);
1798 
1799 
1801 
1819  int insertFromIterator(Qore::AbstractIterator i, *hash<auto> opt);
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 
1987  *hash upsertFromIteratorCommit(Qore::AbstractIterator i, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
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:
2732  bool asteriskRequiresPrefix();
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 
3120  clear();
3121 
3122 
3124 
3131  Columns describe();
3132 
3133 
3135 
3144 
3145 
3147 
3157 
3158 
3159  *AbstractUniqueConstraint findUniqueConstraintUnlocked(string name);
3160 
3161 
3163 
3172  Indexes getIndexes();
3173 
3174 
3176  ForeignConstraints getForeignConstraints(*hash<auto> opt);
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 
3268  bool checkExistence();
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 
3536  bool bindEmptyStringsAsNull();
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 
3601  AbstractSavepointHelper getSavepointHelper(*string savepoint);
3602 
3603 
3605  abstract bool hasArrayBind();
3606 
3608 
3610 protected:
3611  hash<auto> getTableOptions();
3612 public:
3613 
3614 
3616 
3618 protected:
3619  hash<auto> getForeignConstraintOptions();
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:
3643  hash<auto> getTableCreationOptions();
3644 public:
3645 
3646 
3648 
3650 protected:
3651  hash<auto> getAlignTableOptions();
3652 public:
3653 
3654 
3656 
3658 protected:
3659  hash<auto> getTableDescriptionHashOptions();
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:
3683  hash<auto> getTableColumnDescOptions();
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:
3731  hash<auto> getInsertFromIteratorOptions();
3732 public:
3733 
3734 
3736 
3738 protected:
3739  hash<auto> getSqlDataCallbackOptions();
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:
3761  *hash<auto> getColumnOperatorMapImpl();
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:
3825  hash<auto> getRawUpdateOperatorMap();
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:
3936  bool hasReturningImpl();
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:
3964  clearImpl();
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:
4008  abstract bool constraintsLinkedToIndexesImpl();
4009 public:
4010 
4012 protected:
4013  abstract bool uniqueIndexCreatesConstraintImpl();
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:
4114  abstract AbstractSavepointHelper getSavepointHelperImpl(*string savepoint);
4115 public:
4116 };
4117 };
const SelectOptions
default possible select options; can be extended by driver-specific modules
Definition: AbstractTable.qc.dox.h:79
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:230
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:83
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
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:36
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:68
*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:144
the table container class stores a collection of tables in a schema
Definition: SqlUtil.qm.dox.h:4996
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.
deprecated int insertFromSelectNoCommit(list cols, AbstractTable source, *hash< auto > sh, *reference< string > sql, *hash< auto > opt)
A legacy SqlUtil::AbstractTable::insertFromSelect() 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:292
const UpsertStrategyMap
hash mapping upsert strategy codes to a text description
Definition: AbstractTable.qc.dox.h:249
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:264
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:5439
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:5743
const UpsertResultDescriptionMap
hash mapping upsert descriptions to codes
Definition: AbstractTable.qc.dox.h:288
const UR_Deleted
row was deleted (only possible with batch upsert methods such as AbstractTable::upsertFromIterator() ...
Definition: AbstractTable.qc.dox.h:276
const InsertFromIteratorOptions
default insert option keys
Definition: AbstractTable.qc.dox.h:182
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:174
hash< auto > getRawUpdateOperatorMap()
returns the raw (default) update operator map for this object
const CacheOptions
default cache options
Definition: AbstractTable.qc.dox.h:61
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:305
bool native_case
native case option
Definition: AbstractTable.qc.dox.h:311
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:214
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:5809
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:5612
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:297
trigger container class that throws an exception if an unknown trigger is accessed ...
Definition: SqlUtil.qm.dox.h:6025
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:303
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:267
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:5393
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:44
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:301
list< auto > list(...)
bool manual
manual edits
Definition: AbstractTable.qc.dox.h:315
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:102
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:309
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:299
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:5638
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:151
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:282
*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:307
*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:164
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:74
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:244
column container class that throws an exception if an unknown column is accessed
Definition: SqlUtil.qm.dox.h:5182
the base class for triggers
Definition: SqlUtil.qm.dox.h:6007
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:273
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:270
the base class for column information
Definition: SqlUtil.qm.dox.h:5264
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:237
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:52
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:223
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:206
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:133
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 ...
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...
const TableDescriptionHashOptions
Table description options.
Definition: AbstractTable.qc.dox.h:117
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:90
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
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:5732
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:255
*hash< auto > getPseudoColumnHash()
returns a hash of valid pseudocolumns
const ConstraintOptions
default constraint options
Definition: AbstractTable.qc.dox.h:58
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:5723
const AdditionalColumnDescOptions
additional column description keys valid when describing columns in a table description hash ...
Definition: AbstractTable.qc.dox.h:140
hash< auto > getTableOptions()
returns the table options for this driver
abstract base class for constraints
Definition: SqlUtil.qm.dox.h:5550
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:5508