$darkmode
Qore SqlUtil Module Reference 1.9.1
AbstractTable.qc.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
26 namespace SqlUtil {
28 
31 
32 public:
34 
41  const TableOptions = {
42  "native_case": Type::Boolean,
43  "table_cache": "Tables",
44  };
45 
47 
52  const IndexOptions = {
53  "index_tablespace": Type::String,
54  "replace": Type::Boolean,
55  };
56 
58 
61 
63  const CacheOptions = {
64  "table_cache": "Tables",
65  };
66 
68 
73  "table_cache": "Tables",
74  };
75 
77 
80 
82 
85  const SelectOptions = {
86  "alias": Type::String,
87  "comment": Type::String,
88  "hint": Type::String,
89  "columns": Type::NothingType,
90  "where": "hash/list",
91  "orderby": "softstringinthashlist",
92  "desc": Type::Boolean,
93  "limit": Type::Int,
94  "offset": Type::Int,
95  "join": Type::Hash,
96  "groupby": "softstringinthashlist",
97  "having": Type::Hash,
98  "superquery": Type::Hash,
99  "forupdate": Type::Boolean,
100  };
101 
104  "indexes": True,
105  "foreign_constraints": True,
106  "triggers": True,
107  };
108 
110 
114  "omit": "softstringlist",
115  };
116 
118 
127  "column_map": Type::Hash,
128  "index_map": Type::Hash,
129  "constraint_map": Type::Hash,
130  "trigger_map": Type::Hash,
131  "db_table_cache": "Tables",
132  "force": Type::Boolean,
133  };
134 
136 
148  "columns": Type::Hash,
149  "primary_key": Type::Hash,
150  "indexes": Type::Hash,
151  "triggers": Type::Hash,
152  "foreign_constraints": Type::Hash,
153  "unique_constraints": Type::Hash,
154  //"check_constraints": Type::Hash,
155  "table_cache": "Tables",
156  };
157 
159 
172  "qore_type": Type::String,
173  "native_type": Type::String,
174  "size": Type::Int,
175  "scale": Type::Int,
176  "default_value": Type::NothingType,
177  "default_value_native": Type::Boolean,
178  "comment": Type::String,
179  "notnull": Type::Boolean,
180  "driver": Type::Hash,
181  };
182 
184 
188  "notnull": Type::Boolean,
189  };
190 
192  const ColumnOptions = {};
193 
195 
200  "sqlarg_callback": "code",
201  "tablecode": "code",
202  };
203 
205 
215  "returning": "stringhashlist",
216  };
217 
219 
225  const UpsertOptions = {
226  "info_callback": "code",
227  "commit_block": Type::Int,
228  "delete_others": Type::Boolean,
229  "omit_update": "softstringlist",
230  };
231 
233 
238  "info_callback": "code",
239  "commit_block": Type::Int,
240  };
241 
258 
263  const UpsertInsertFirst = 1;
264 
266 
271  const UpsertUpdateFirst = 2;
272 
274 
280  const UpsertSelectFirst = 3;
281 
283 
287  const UpsertAuto = 4;
288 
290 
294  const UpsertInsertOnly = 5;
295 
297 
301  const UpsertUpdateOnly = 6;
302 
304 
307  UpsertInsertFirst: "UpsertInsertFirst",
308  UpsertUpdateFirst: "UpsertUpdateFirst",
309  UpsertSelectFirst: "UpsertSelectFirst",
310  UpsertAuto: "UpsertAuto",
311  UpsertInsertOnly: "UpsertInsertOnly",
312  UpsertUpdateOnly: "UpsertUpdateOnly",
313  };
314 
316 
319  "UpsertInsertFirst": UpsertInsertFirst,
320  "UpsertUpdateFirst": UpsertUpdateFirst,
321  "UpsertSelectFirst": UpsertSelectFirst,
322  "UpsertAuto": UpsertAuto,
323  "UpsertInsertOnly": UpsertInsertOnly,
324  "UpsertUpdateOnly": UpsertUpdateOnly,
325  };
327 
333  const UR_Inserted = 1;
334 
336  const UR_Verified = 2;
337 
339  const UR_Updated = 3;
340 
342  const UR_Unchanged = 4;
343 
345  const UR_Deleted = 5;
347 
349 
351  const UpsertResultMap = {
352  UR_Inserted: "inserted",
353  UR_Verified: "verified",
354  UR_Updated: "updated",
355  UR_Unchanged: "unchanged",
356  UR_Deleted: "deleted",
357  };
358 
360 
363  "inserted": UR_Inserted,
364  "verified": UR_Verified,
365  "updated": UR_Updated,
366  "unchanged": UR_Unchanged,
367  "deleted": UR_Deleted,
368  };
369 
372  UR_Inserted: "I",
373  UR_Verified: "V",
374  UR_Updated: "U",
375  UR_Unchanged: ".",
376  UR_Deleted: "X",
377  };
378 
379 protected:
381  string name;
397  bool inDb = False;
399  bool manual = False;
400 
401  hash m_customCopMap = {};
402 
403 public:
404 
406 
414 protected:
415  constructor(AbstractDatasource nds, string nname, *hash nopts) ;
416 public:
417 
418 
421 
422 
424 
435  setDatasource(AbstractDatasource nds);
436 
437 
438 protected:
439  doTableOptions(*hash<auto> nopts);
440 public:
441 
442 
445 
446 
449 
450 
453 
454 
456 
465  bool inDb();
466 
467 
469 
477 
478 
480 
492  dropCommit(*hash<auto> opt);
493 
494 
496 
510  drop(*hash<auto> opt);
511 
512 
514  deprecated dropNoCommit(*hash<auto> opt);
515 
517 
528  auto tryExec(string sql);
529 
530 
532 
542  auto tryExecArgs(string sql, *softlist<auto> args);
543 
544 
546 
557  auto tryExecRaw(string sql);
558 
559 
561 
573  softlist<auto> getDropSql(*hash<auto> opt);
574 
575 
577 
586 
587 
589 
601 
602 
604  deprecated truncateNoCommit();
605 
607 
625  string getTruncateSql(*hash<auto> opt);
626 
627 
629 
638  createCommit(*hash<auto> opt);
639 
640 
642 
656  create(*hash<auto> opt);
657 
658 
660  deprecated createNoCommit(*hash<auto> opt);
661 
663 
679  rename(string new_name, *reference<string> sql, *Tables table_cache);
680 
681 
682 protected:
683  doRenameIntern(string new_name, *Tables table_cache);
684 public:
685 
686 
688 
699  bool emptyData();
700 
701 
703 
712  bool empty();
713 
714 
715 protected:
716  bool emptyUnlocked();
717 public:
718 
719 
721 
729  setupTable(hash<auto> desc, *hash<auto> opt);
730 
731 
733 
757  AbstractColumn addColumn(string cname, hash<auto> opt, bool nullable = True, *reference lsql);
758 
759 
761 
790  list<auto> getAddColumnSql(string cname, hash<auto> copt, bool nullable = True, *hash<auto> opt);
791 
792 
793 protected:
794  AbstractColumn addColumnUnlocked(string cname, hash<auto> opt, bool nullable = True, *reference lsql, bool do_exec = True, bool modify_table = True);
795 public:
796 
797 
798 protected:
799  addColumnToTableUnlocked(AbstractColumn c);
800 public:
801 
802 
804 
829  AbstractColumn modifyColumn(string cname, hash<auto> opt, bool nullable = True, *reference lsql);
830 
831 
833 
860  list<auto> getModifyColumnSql(string cname, hash<auto> copt, bool nullable = True, *hash<auto> opt);
861 
862 
864 
881  AbstractColumn renameColumn(string old_name, string new_name, reference<string> sql);
882 
883 
885 
903  string getRenameColumnSql(string old_name, string new_name, *hash<auto> opt);
904 
905 
906 protected:
907  AbstractColumn renameColumnIntern(AbstractColumn c, string new_name);
908 public:
909 
910 
911 protected:
912  validateOptionsIntern(string err, hash<auto> ropt, reference<hash<auto>> opt);
913 public:
914 
915 
916 protected:
917  validateOptionsIntern(string err, hash<auto> ropt, reference<hash<auto>> opt, string tag);
918 public:
919 
920 
921 protected:
922  execSql(softlist lsql);
923 public:
924 
925 
927 
947  AbstractPrimaryKey addPrimaryKey(string pkname, softlist cols, *hash<auto> opt, *reference<string> sql);
948 
949 
951 
973  string getAddPrimaryKeySql(string pkname, softlist cols, *hash pkopt, *hash<auto> opt);
974 
975 
976 protected:
977  setPrimaryKeyUnlocked(AbstractPrimaryKey pk);
978 public:
979 
980 
981 protected:
982  AbstractPrimaryKey addPrimaryKeyUnlocked(string pkname, softlist cols, *hash<auto> opt, *reference<string> sql);
983 public:
984 
985 
986 protected:
987  AbstractPrimaryKey addPrimaryKeyUnlockedIntern(string pkname, softlist cols, *hash<auto> opt, *reference<string> sql);
988 public:
989 
990 
992 
1008  list<auto> getDropAllConstraintsAndIndexesOnColumnSql(string cname, *hash<auto> opt);
1009 
1010 
1011 protected:
1012  list<auto> getDropAllConstraintsAndIndexesOnColumnSqlUnlocked(string cname, *hash<auto> opt);
1013 public:
1014 
1015 
1017 
1036  list<auto> getDropPrimaryKeySql(*hash<auto> opt);
1037 
1038 
1040 
1059 
1060 
1062 
1083  AbstractUniqueConstraint addUniqueConstraint(string cname, softlist cols, *hash<auto> opt, *reference<string> sql);
1084 
1085 
1087 
1107  string getAddUniqueConstraintSql(string cname, softlist cols, *hash ukopt, *hash<auto> opt);
1108 
1109 
1110 protected:
1111  AbstractUniqueConstraint addUniqueConstraintUnlocked(string cname, softlist cols, *hash<auto> opt, *reference<string> sql);
1112 public:
1113 
1114 
1115 protected:
1116  AbstractUniqueConstraint addUniqueConstraintUnlockedIntern(string cname, softlist cols, *hash<auto> opt, *reference<string> sql);
1117 public:
1118 
1119 
1121 
1142  AbstractIndex addIndex(string iname, bool unique, softlist cols, *hash<auto> opt, *reference<string> sql);
1143 
1144 
1146 
1167  string getAddIndexSql(string iname, bool unique, softlist cols, *hash<auto> ixopt, *hash<auto> opt);
1168 
1169 
1170 protected:
1171  AbstractIndex addIndexUnlocked(string iname, bool unique, softlist cols, *hash<auto> opt, *reference<string> sql);
1172 public:
1173 
1174 
1175 protected:
1176  AbstractIndex addIndexUnlockedIntern(string iname, bool unique, softlist cols, *hash<auto> opt, *reference<string> sql);
1177 public:
1178 
1179 
1181 
1193  AbstractIndex renameIndex(string old_name, string new_name, reference<string> sql);
1194 
1195 
1197 
1215  AbstractIndex dropIndex(string iname, *reference<string> sql);
1216 
1217 
1219 
1238  string getDropIndexSql(string iname, *hash<auto> opt);
1239 
1240 
1242 
1264  AbstractForeignConstraint addForeignConstraint(string cname, softlist cols, string table, *softlist tcols, *hash<auto> opt, *reference<string> sql);
1265 
1266 
1268 
1290  string getAddForeignConstraintSql(string cname, softlist cols, string table, *softlist tcols, *hash fkopt, *hash<auto> opt);
1291 
1292 
1293 protected:
1294  Columns getReferencedTableColumnsUnlocked(string table, *Tables cache, string err = 'FOREIGN-CONSTRAINT-ERROR');
1295 public:
1296 
1297 
1298 protected:
1299  AbstractForeignConstraint addForeignConstraintUnlocked(string cname, softlist cols, string table, *softlist tcols, *hash<auto> opt, *reference<string> sql);
1300 public:
1301 
1302 
1303 protected:
1304  AbstractForeignConstraint addForeignConstraintUnlockedIntern(string cname, softlist cols, string table, *softlist tcols, *hash<auto> opt, *reference<string> sql);
1305 public:
1306 
1307 
1309 
1327  AbstractForeignConstraint dropForeignConstraint(string cname, *reference<string> sql);
1328 
1329 
1331 
1347 
1348 
1350 
1370  AbstractCheckConstraint addCheckConstraint(string cname, string src, *hash<auto> opt, *reference<string> sql);
1371 
1372 
1374 
1396  string getAddCheckConstraintSql(string cname, string src, *hash copt, *hash<auto> opt);
1397 
1398 
1399 protected:
1400  AbstractCheckConstraint addCheckConstraintUnlocked(string cname, string src, *hash<auto> opt, *reference<string> sql);
1401 public:
1402 
1403 
1404 protected:
1405  AbstractCheckConstraint addCheckConstraintUnlockedIntern(string cname, string src, *hash<auto> opt, *reference<string> sql);
1406 public:
1407 
1408 
1410 
1422  AbstractConstraint renameConstraint(string old_name, string new_name, reference lsql);
1423 
1424 
1426 
1445  string getDropConstraintSql(string cname, *hash<auto> opt);
1446 
1447 
1449 
1468  *string getDropConstraintIfExistsSql(string cname, *hash<auto> opt, *reference<AbstractConstraint> cref);
1469 
1470 
1471 protected:
1472  AbstractConstraint findDropConstraintUnlocked(string cname, reference<code> rmv);
1473 public:
1474 
1475 
1477 
1495  AbstractConstraint dropConstraint(string cname, *reference<string> sql);
1496 
1497 
1499 
1519  AbstractTrigger addTrigger(string tname, string src, *hash<auto> opt, *reference lsql);
1520 
1521 
1523 
1545  list<auto> getAddTriggerSql(string tname, string src, *hash topt, *hash<auto> opt);
1546 
1547 
1548 protected:
1549  AbstractTrigger addTriggerUnlocked(string tname, string src, *hash<auto> opt, *reference lsql);
1550 public:
1551 
1552 
1553 protected:
1554  AbstractTrigger addTriggerUnlockedIntern(string tname, string src, *hash<auto> opt, *reference lsql);
1555 public:
1556 
1557 
1559 
1577  AbstractTrigger dropTrigger(string tname, *reference<string> sql);
1578 
1579 
1581 
1600  list<auto> getDropTriggerSql(string tname, *hash<auto> opt);
1601 
1602 
1603 protected:
1604  getAllConstraintsUnlocked(*hash<auto> opt);
1605 public:
1606 
1607 
1608 protected:
1609  checkUniqueConstraintName(string err, string cname);
1610 public:
1611 
1612 
1613 protected:
1614  checkUniqueConstraintNameValidateOptions(string err, string cname, hash<auto> ropt, reference<hash> opt);
1615 public:
1616 
1617 
1619 protected:
1620  validateColumnOptions(string cname, reference<hash> opt, bool nullable);
1621 public:
1622 
1623 
1625 
1643  AbstractColumn dropColumn(string cname, *reference lsql);
1644 
1645 
1647 
1666  list<auto> getDropColumnSql(string cname, *hash<auto> opt);
1667 
1668 
1670 
1681  *hash<auto> insertCommit(hash<auto> row);
1682 
1683 
1685 
1689  *hash<auto> insertCommit(hash<auto> row, reference<string> sql);
1690 
1691 
1693 
1697  *hash<auto> insertCommit(hash<auto> row, hash<auto> opt);
1698 
1699 
1701 
1706  *hash<auto> insertCommit(hash<auto> row, reference<string> sql, hash<auto> opt);
1707 
1708 
1710 
1722  *hash<auto> insert(hash<auto> row);
1723 
1724 
1726 
1730  *hash<auto> insert(hash<auto> row, reference<string> sql);
1731 
1732 
1734 
1738  *hash<auto> insert(hash<auto> row, hash<auto> opt);
1739 
1740 
1742 
1747  *hash<auto> insert(hash<auto> row, reference<string> sql, hash<auto> opt);
1748 
1749 
1751 
1760  hash<SqlResultInfo> insertWithInfo(hash<auto> row, *hash<auto> opt);
1761 
1762 
1764  deprecated *hash<auto> insertNoCommit(hash<auto> row, *reference<string> sql, *hash<auto> opt);
1765 
1767  deprecated *hash<auto> insertNoCommit(hash<auto> row, hash<auto> opt);
1768 
1769 protected:
1770  *hash<auto> insertIntern(hash<auto> row, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
1771 public:
1772 
1773 
1774 protected:
1775  hash<auto> getPlaceholdersAndValues(hash<auto> row);
1776 public:
1777 
1778 
1780 
1784 
1785 
1787 
1806  int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh, reference<string> sql, hash<auto> opt);
1807 
1808 
1811 
1812 
1814  int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh);
1815 
1816 
1818  int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh, reference<string> sql);
1819 
1820 
1822  int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh, hash<auto> opt);
1823 
1824 
1826 
1845  int insertFromSelect(list cols, AbstractTable source, hash<auto> sh, reference<string> sql, hash<auto> opt);
1846 
1847 
1850 
1851 
1853  int insertFromSelect(list cols, AbstractTable source, hash<auto> sh);
1854 
1855 
1857  int insertFromSelect(list cols, AbstractTable source, hash<auto> sh, reference<string> sql);
1858 
1859 
1861  int insertFromSelect(list cols, AbstractTable source, hash<auto> sh, hash<auto> opt);
1862 
1863 
1865 
1878  hash<SqlResultInfo> insertFromSelectWithInfo(list<auto> cols, AbstractTable source, hash<auto> select_hash, *hash<auto> opt);
1879 
1880 
1882  deprecated int insertFromSelectNoCommit(list cols, AbstractTable source, *hash<auto> sh, *reference<string> sql, *hash<auto> opt);
1883 
1884 protected:
1885  int insertFromSelectIntern(list cols, AbstractTable source, *hash<auto> sh, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
1886 public:
1887 
1888 
1890 
1909 
1910 
1912 
1931 
1932 
1934  deprecated int insertFromIteratorNoCommit(Qore::AbstractIterator i, *hash<auto> opt);
1935 
1936 protected:
1937  int insertFromIteratorIntern(Qore::AbstractIterator i, *hash<auto> opt);
1938 public:
1939 
1940 
1942 
1958  int upsertCommit(hash<auto> row, int upsert_strategy = UpsertAuto, *hash<auto> opt);
1959 
1960 
1962 
1978  int upsert(hash<auto> row, int upsert_strategy = UpsertAuto, *hash<auto> opt);
1979 
1980 
1982  deprecated int upsertNoCommit(hash<auto> row, int upsert_strategy = UpsertAuto);
1983 
1985 
2006  code getUpsertClosure(hash<auto> row, int upsert_strategy = UpsertAuto, *hash<auto> opt);
2007 
2008 
2010 
2037  code getBulkUpsertClosure(hash<auto> example_row, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2038 
2039 
2041 
2062  code getUpsertClosureWithValidation(hash<auto> example_row, int upsert_strategy = UpsertAuto, *hash<auto> opt);
2063 
2064 
2066 
2098  *hash<string, int> upsertFromIteratorCommit(Qore::AbstractIterator i, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2099 
2100 
2102 
2134  *hash<string, int> upsertFromIterator(Qore::AbstractIterator i, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2135 
2136 
2138  deprecated *hash<string, int> upsertFromIteratorNoCommit(Qore::AbstractIterator i, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2139 
2140 protected:
2141  *hash<string, int> upsertFromIteratorIntern(Qore::AbstractIterator i, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2142 public:
2143 
2144 
2145 protected:
2146  *hash<string, int> doDeleteOthersIntern(hash<auto> pkh, *hash<auto> opt);
2147 public:
2148 
2149 
2151 
2213  *hash<string, int> upsertFromSelectCommit(AbstractTable t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2214 
2215 
2217  *hash<string, int> upsertFromSelectCommit(Table t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2218 
2219 
2221 
2261  *hash<string, int> upsertFromSelect(AbstractTable t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2262 
2263 
2265  deprecated *hash<string, int> upsertFromSelectNoCommit(AbstractTable t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2266 
2268  deprecated *hash<string, int> upsertFromSelect(Table t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2269 
2271  deprecated *hash<string, int> upsertFromSelectNoCommit(Table t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2272 
2274 
2285  softint rowCount();
2286 
2287 
2289 
2310  Qore::SQL::SQLStatement getRowIterator(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2311 
2312 
2314 
2337  Qore::SQL::SQLStatement getRowIteratorNoExec(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2338 
2339 
2341 
2361  Qore::SQL::SQLStatement getRowIterator(*hash<auto> sh, *hash<auto> opt);
2362 
2363 
2365 
2387  Qore::SQL::AbstractSQLStatement getStatement(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2388 
2389 
2391 
2412  Qore::SQL::AbstractSQLStatement getStatement(*hash<auto> sh, *hash<auto> opt);
2413 
2414 
2416 
2448  hash<SqlResultInfo> getStatementWithInfo(*hash<auto> select_hash, *hash<auto> opt);
2449 
2450 
2452 
2474  Qore::SQL::AbstractSQLStatement getStatementNoExec(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2475 
2476 
2478 
2506  hash<SqlResultInfo> getStatementNoExecWithInfo(*hash<auto> select_hash, *hash<auto> opt);
2507 
2508 
2510 
2531  Qore::SQL::AbstractSQLStatement getStatementNoExec(*hash<auto> sh, *hash<auto> opt);
2532 
2533 
2534 protected:
2535  Qore::SQL::AbstractSQLStatement getStatementIntern(*hash<auto> sh, *reference<string> sql, *hash<auto> opt, *bool no_exec, *reference<softlist<auto>> args);
2536 public:
2537 
2538 
2540 
2561  *hash<auto> selectRow(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2562 
2563 
2564 protected:
2565  *hash<auto> selectRowIntern(*hash<auto> sh, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
2566 public:
2567 
2568 
2570 
2596  hash<SqlResultInfo> selectRowWithInfo(*hash<auto> select_hash, *hash<auto> opt);
2597 
2598 
2600 
2620  *list<auto> selectRows(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2621 
2622 
2623 protected:
2624  *list<auto> selectRowsIntern(*hash<auto> sh, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
2625 public:
2626 
2627 
2629 
2654  hash<SqlResultInfo> selectRowsWithInfo(*hash<auto> select_hash, *hash<auto> opt);
2655 
2656 
2658 
2677  *hash<auto> select(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2678 
2679 
2680 protected:
2681  *hash<auto> selectIntern(*hash<auto> sh, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
2682 public:
2683 
2684 
2686 
2711  hash<SqlResultInfo> selectWithInfo(*hash<auto> select_hash, *hash<auto> opt);
2712 
2713 
2715 
2733  *hash<auto> selectRow(*hash<auto> sh, *hash<auto> opt);
2734 
2735 
2737 
2754  *list<auto> selectRows(*hash<auto> sh, *hash<auto> opt);
2755 
2756 
2758 
2775  *hash<auto> select(*hash<auto> sh, *hash<auto> opt);
2776 
2777 
2779 
2797  string getSelectSql(*hash<auto> sh, *reference<list<auto>> args);
2798 
2799 
2800  *AbstractUniqueConstraint matchAnyUnique(softlist<auto> cols);
2801 
2802 
2803  string getSelectSqlIntern(*hash<auto> qh, reference<list<auto>> args, *hash<auto> opt);
2804 
2805 
2806  string getSelectSqlUnlocked(*hash<auto> qh, reference<list<auto>> args, *hash<auto> opt);
2807 
2808 
2809  // column & table information must be retrieved before calling this method
2810  string getSelectSqlUnlockedIntern(*hash<auto> qh, string from, reference<list<auto>> args, *hash<string, bool> subquery_column_map, *hash<auto> opt, *hash<auto> pseudo_column_map);
2811 
2812 
2814  AbstractTable getSubtableFromString(string table, *hash<auto> opt);
2815 
2816 
2817  string getExpressionArg(reference<hash<QueryInfo>> info, int role, auto arg, AbstractDataProviderType expected_type);
2818 
2819 
2820 protected:
2821  string getFromIntern(string from, *hash<auto> qh);
2822 public:
2823 
2824 
2825 protected:
2826  list<auto> getGroupByListUnlocked(hash<QueryInfo> info, list<auto> coll);
2827 public:
2828 
2829 
2830 protected:
2831  list<auto> getOrderByListUnlocked(hash<QueryInfo> info, list<auto> coll);
2832 public:
2833 
2834 
2835 protected:
2836  list<auto> getGroupOrderByListUnlocked(hash<QueryInfo> info, string key, list<auto> coll);
2837 public:
2838 
2839 
2840 protected:
2841  doForUpdate(reference<string> sql);
2842 public:
2843 
2844 
2845 protected:
2846  string getSelectSqlName(*hash<auto> qh);
2847 public:
2848 
2849 
2850 protected:
2851  string getColumnExpressionIntern(reference<hash<QueryInfo>> info, auto cvc);
2852 public:
2853 
2854 
2855 protected:
2856  string doColumnOperatorIntern(reference<hash<QueryInfo>> info, hash<auto> cvc);
2857 public:
2858 
2859 
2860 protected:
2861  string doColumnOperatorIntern(reference<hash<QueryInfo>> info, auto cop, auto arg, *string cve);
2862 public:
2863 
2864 
2865 protected:
2866  string getColumnNameIntern(hash<QueryInfo> info, string column_name);
2867 public:
2868 
2869 
2871 protected:
2873 public:
2874 
2875 
2876 protected:
2877  getSelectWhereSqlUnlocked(reference<hash<QueryInfo>> info, reference<string> sql);
2878 public:
2879 
2880 
2881 protected:
2882  *string getWhereClause(*hash<auto> cond, reference<list<auto>> args, *string cprefix, *hash<string, AbstractTable> join_map);
2883 public:
2884 
2885 
2886 protected:
2887  *string getWhereExpressionUnlocked(reference<hash<QueryInfo>> info, hash<DataProviderExpression> cond, *string cprefix);
2888 public:
2889 
2890 
2891 protected:
2892  *string getExpressionUnlockedIntern(reference<hash<QueryInfo>> info, int role, hash<DataProviderExpression> cond, AbstractDataProviderType expected_type);
2893 public:
2894 
2895 
2896 protected:
2897  *string getWhereClauseUnlocked(reference<hash<QueryInfo>> info, *hash<auto> cond, *string cprefix);
2898 public:
2899 
2900 
2901 protected:
2902  *list<string> getWhereClauseIntern(reference<hash<QueryInfo>> info, *hash<auto> cond, *string cprefix);
2903 public:
2904 
2905 
2906 protected:
2907  string doWhereExpressionIntern(reference<hash<QueryInfo>> info, string cn, auto we);
2908 public:
2909 
2910 
2911  string getOrClause(reference<hash<QueryInfo>> info, list<auto> arglist);
2912 
2913 
2914  string getOrClause(reference<hash<QueryInfo>> info, hash<auto> arg);
2915 
2916 
2917 protected:
2918  doSelectOrderBySqlUnlocked(hash<QueryInfo> info, reference<string> sql, list<auto> coll);
2919 public:
2920 
2921 
2923 
2939  int delCommit(hash<auto> cond, reference<string> sql, hash<auto> opt);
2940 
2941 
2943  int delCommit(hash<auto> cond, hash<auto> opt);
2944 
2945 
2947  int delCommit(hash<auto> cond, reference<string> sql);
2948 
2949 
2951  int delCommit(hash<auto> cond);
2952 
2953 
2955  int delCommit();
2956 
2957 
2959 
2974  int del(hash<auto> cond, reference<string> sql, hash<auto> opt);
2975 
2976 
2978  int del(hash<auto> cond, hash<auto> opt);
2979 
2980 
2982  int del(hash<auto> cond, reference<string> sql);
2983 
2984 
2986  int del(hash<auto> cond);
2987 
2988 
2990  int del();
2991 
2992 
2994 
3008  hash<SqlResultInfo> delWithInfo(hash<auto> cond, *hash<auto> opt);
3009 
3010 
3012  deprecated int delNoCommit(*hash<auto> cond, *reference<string> sql);
3013 
3014 protected:
3015  int delIntern(*hash<auto> cond, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
3016 public:
3017 
3018 
3020 
3037  int updateCommit(hash<auto> set, hash<auto> cond, reference<string> sql, hash<auto> opt);
3038 
3039 
3041  int updateCommit(hash<auto> set, hash<auto> cond, reference<string> sql);
3042 
3043 
3045  int updateCommit(hash<auto> set, hash<auto> cond, hash<auto> opt);
3046 
3047 
3049  int updateCommit(hash<auto> set, hash<auto> cond);
3050 
3051 
3053  int updateCommit(hash<auto> set);
3054 
3055 
3057 
3074  int update(hash<auto> set, hash<auto> cond, reference<string> sql, hash<auto> opt);
3075 
3076 
3078  int update(hash<auto> set, hash<auto> cond, reference<string> sql);
3079 
3080 
3082  int update(hash<auto> set, hash<auto> cond, hash<auto> opt);
3083 
3084 
3086  int update(hash<auto> set, hash<auto> cond);
3087 
3088 
3090  int update(hash<auto> set);
3091 
3092 
3094 
3112  hash<SqlResultInfo> updateWithInfo(hash<auto> set, hash<auto> cond, *hash<auto> opt);
3113 
3114 
3116 
3128  hash<SqlCommandInfo> getUpdateSql(hash<auto> set, *hash<auto> cond);
3129 
3130 
3132  deprecated int updateNoCommit(hash<auto> set, *hash<auto> cond, *reference<string> sql);
3133 
3135  deprecated int updateNoCommit(hash<auto> set, *hash<auto> cond, *hash<auto> opt);
3136 
3137 protected:
3138  int updateIntern(hash<auto> set, *hash<auto> cond, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
3139 public:
3140 
3141 
3142 protected:
3143  string getUpdateExpression(string col, hash<UpdateOperatorInfo> uh);
3144 public:
3145 
3146 
3147 protected:
3148  bool emptyDataIntern();
3149 public:
3150 
3151 
3152 protected:
3153  Columns checkUpsertRow(hash<auto> row, reference<int> upsert_strategy);
3154 public:
3155 
3156 
3157 protected:
3158  code getUpsertInsertFirst(Columns cols, hash<auto> example_row, *hash<auto> opt);
3159 public:
3160 
3161 
3162 protected:
3163  code getUpsertUpdateFirst(Columns cols, hash<auto> example_row, *hash<auto> opt);
3164 public:
3165 
3166 
3167 protected:
3168  code getUpsertSelectFirst(Columns cols, hash<auto> example_row, *hash<auto> opt);
3169 public:
3170 
3171 
3172 protected:
3173  code getUpsertInsertOnly(Columns cols, hash<auto> example_row, *hash<auto> opt);
3174 public:
3175 
3176 
3177 protected:
3178  code getUpsertUpdateOnly(Columns cols, hash<auto> example_row, *hash<auto> opt);
3179 public:
3180 
3181 
3182 protected:
3183  Columns getUpsertColumns(reference<string> csrc);
3184 public:
3185 
3186 
3188 
3196 protected:
3197  hash<string, Columns> getAllUpsertColumns(*hash<auto> row);
3198 public:
3199 
3200 
3201 protected:
3202  bool matchUniqueColumns(Columns cols, hash<auto> row);
3203 public:
3204 
3205 
3206 protected:
3207  string getUpsertSelectSql(hash<auto> row, Columns cols, reference<list<string>> updc);
3208 public:
3209 
3210 
3211 protected:
3212  string getUpsertInsertSql(hash<auto> row);
3213 public:
3214 
3215 
3216 protected:
3217  string getUpsertUpdateSql(hash<auto> row, Columns cols, reference updc, *hash<auto> opt);
3218 public:
3219 
3220 
3221 protected:
3222  softbool tryUpdate(string sql, hash<auto> row, Columns cols, list updc);
3223 public:
3224 
3225 
3226 protected:
3227  checkValue(string cname, string argname, reference val, string type);
3228 public:
3229 
3230 
3232 
3241  string getSqlFromList(list<auto> l);
3242 
3243 
3245 
3256  string getSqlValue(auto v);
3257 
3258 
3260  string getName();
3261 
3262 
3264 
3271  cache(*hash<auto> opts);
3272 
3273 
3275 
3281 
3282 
3284 
3294  hash<auto> getDescriptionHash();
3295 
3296 
3298 
3306 
3307 
3309 
3318 
3319 
3321 
3331 
3332 
3333  *AbstractUniqueConstraint findUniqueConstraintUnlocked(string name);
3334 
3335 
3337 
3347 
3348 
3351 
3352 
3355 
3356 
3358 
3368 
3369 
3371 
3393  string getRenameSql(string new_name, *hash<auto> opt);
3394 
3395 
3397 
3406  string getCreateSqlString(*hash<auto> opt);
3407 
3408 
3410 
3419  list<auto> getCreateSql(*hash<auto> opt);
3420 
3421 
3423 
3434  string getCreateTableSql(*hash<auto> opt);
3435 
3436 
3438 
3443 
3444 
3445 protected:
3446  *hash<string, bool> getCheckOmissionOptions(*softlist<softstring> ol, string err);
3447 public:
3448 
3449 
3451 
3473  list<auto> getAlignSql(AbstractTable t, *hash<auto> opt);
3474 
3475 
3476 protected:
3477  list<auto> getAlignSqlUnlocked(AbstractTable t, *hash<auto> opt);
3478 public:
3479 
3480 
3481 protected:
3482  *AbstractColumnSupportingConstraint getSupportingConstraint(string ixname);
3483 public:
3484 
3485 
3486 protected:
3487  *list<AbstractColumnConstraint> getAllSupportingConstraints(string ixname);
3488 public:
3489 
3490 
3491 protected:
3492  renameIndexUnlocked(AbstractIndex ix, string new_name);
3493 public:
3494 
3495 
3497 
3510  string getAlignSqlString(AbstractTable t, *hash<auto> opt);
3511 
3512 
3514 
3526  *list<auto> getCreateIndexesSql(*hash<auto> opt, bool cache = True);
3527 
3528 
3530 
3542  *string getCreatePrimaryKeySql(*hash<auto> opt, bool cache = True);
3543 
3544 
3546 
3558  *list<auto> getCreateForeignConstraintsSql(*hash<auto> opt, bool cache = True);
3559 
3560 
3562 
3576  *list<auto> getCreateConstraintsSql(*hash<auto> opt, bool cache = True);
3577 
3578 
3580 
3592  *list<auto> getCreateMiscSql(*hash<auto> opt, bool cache = True);
3593 
3594 
3596 
3610  *list<auto> getCreateTriggersSql(*hash<auto> opt, bool cache = True);
3611 
3612 
3614 
3621  *hash find(auto id);
3622 
3623 
3625 
3636  *list find(list<auto> ids);
3637 
3638 
3639 protected:
3640  string getPrimaryKeyColumn();
3641 public:
3642 
3643 
3645 
3658  *hash<auto> find(hash<auto> row);
3659 
3660 
3662 
3675  *hash<auto> findSingle(*hash<auto> cond);
3676 
3677 
3679 
3692  *list<auto> findAll(*hash<auto> cond);
3693 
3694 
3696 
3700  string getDesc();
3701 
3702 
3704  string getBaseType();
3705 
3706 
3708  string getSqlName();
3709 
3710 
3712  string getColumnSqlName(string col);
3713 
3714 
3716  list<auto> getColumnSqlNames(softlist cols);
3717 
3718 
3720 
3723 
3724 
3726 
3730  *hash<string, AbstractDataField> getRecordType();
3731 
3732 
3734 
3743  AbstractDataField getColumnDataField(string column_name, *hash<auto> options, *string append_desc);
3744 
3745 
3747 
3755  AbstractDataField getColumnDataField(AbstractColumn column, *hash<SqlUtilDataTypeOptionInfo> options, *string append_desc);
3756 
3757 
3759 
3767  AbstractDataProviderType getColumnDataType(string column_name, *hash<SqlUtilDataTypeOptionInfo> options);
3768 
3769 
3771 
3773  AbstractDataProviderType getDbType(AbstractColumn column, *hash<SqlUtilDataTypeOptionInfo> options);
3774 
3775 
3777 
3779  AbstractDataProviderType getDbType(string native_type, *string qore_type, bool nullable, int max_size = -1, *hash<SqlUtilDataTypeOptionInfo> options);
3780 
3781 
3783 
3785  AbstractDataProviderType getNumericType(string type_name, bool nullable, *hash<auto> options);
3786 
3787 
3789 
3794 
3795 
3797 
3801  hash<auto> getExpressionMap();
3802 
3803 
3805 
3807  hash<auto> getWhereOperatorMap();
3808 
3809 
3811  abstract bool hasArrayBind();
3812 
3814 
3816 protected:
3817  hash<auto> getTableOptions();
3818 public:
3819 
3820 
3822 
3824 protected:
3826 public:
3827 
3828 
3830 
3832 protected:
3833  hash<auto> getConstraintOptions();
3834 public:
3835 
3836 
3838 
3840 protected:
3841  hash<auto> getCacheOptions();
3842 public:
3843 
3844 
3846 
3848 protected:
3850 public:
3851 
3852 
3854 
3856 protected:
3857  hash<auto> getAlignTableOptions();
3858 public:
3859 
3860 
3862 
3864 protected:
3866 public:
3867 
3868 
3870 
3872 protected:
3873  hash<auto> getColumnOptions();
3874 public:
3875 
3876 
3878 
3880 protected:
3881  hash<auto> getColumnDescOptions();
3882 public:
3883 
3884 
3886 
3888 protected:
3890 public:
3891 
3892 
3894 
3896 protected:
3897  hash<auto> getIndexOptions();
3898 public:
3899 
3900 
3902 
3904 protected:
3905  hash<auto> getTriggerOptions();
3906 public:
3907 
3908 
3910 
3912 protected:
3913  hash<auto> getSelectOptions();
3914 public:
3915 
3916 
3918 
3920 protected:
3921  hash<auto> getUpsertOptions();
3922 public:
3923 
3924 
3926 
3928 protected:
3929  hash<auto> getInsertOptions();
3930 public:
3931 
3932 
3934 
3936 protected:
3938 public:
3939 
3940 
3942 
3944 protected:
3946 public:
3947 
3948 
3950 
3952 protected:
3953  hash<auto> getColumnOperatorMap();
3954 public:
3955 
3956 
3958 protected:
3960 public:
3961 
3962 
3964 
4000  addCustomCopOperator(string name, hash<auto> operator);
4001 
4002 
4004 
4006  bool isDuplicateRowError(hash<ExceptionInfo> ex);
4007 
4008 
4010 
4012 protected:
4013  hash<auto> getInsertOperatorMap();
4014 public:
4015 
4016 
4018 
4020 protected:
4021  hash<auto> getUpdateOperatorMap();
4022 public:
4023 
4024 
4026 
4028 protected:
4030 public:
4031 
4032 
4034 
4036 protected:
4037  *hash<auto> getPseudoColumnHash();
4038 public:
4039 
4040 
4041 protected:
4042  string getCreateTableSqlUnlocked(*hash<auto> opt);
4043 public:
4044 
4045 
4046 protected:
4047  *list<auto> getCreateIndexesSqlUnlocked(*hash<auto> opt, bool cache = True);
4048 public:
4049 
4050 
4051 protected:
4052  *string getCreatePrimaryKeySqlUnlocked(*hash<auto> opt, bool cache = True);
4053 public:
4054 
4055 
4056 protected:
4057  *list<auto> getCreateConstraintsSqlUnlocked(*hash<auto> opt, bool cache = True);
4058 public:
4059 
4060 
4061 protected:
4062  *list<auto> getCreateForeignConstraintsSqlUnlocked(*hash<auto> opt, bool cache = True);
4063 public:
4064 
4065 
4066 protected:
4067  *list<auto> getCreateMiscSqlUnlocked(*hash<auto> opt, bool cache = True);
4068 public:
4069 
4070 
4071 protected:
4072  *list<auto> getCreateTriggersSqlUnlocked(*hash<auto> opt, bool cache = True);
4073 public:
4074 
4075 
4076 protected:
4077  list<auto> getCreateSqlUnlocked(*hash<auto> opt, bool cache = True);
4078 public:
4079 
4080 
4081 protected:
4082  cacheUnlocked(*hash<auto> opt);
4083 public:
4084 
4085 
4086 protected:
4087  auto execData(*hash<auto> opt, string sql, *list<auto> args);
4088 public:
4089 
4090 
4091 protected:
4092  execData(AbstractSQLStatement stmt, *hash<auto> opt, *list<auto> args);
4093 public:
4094 
4095 
4096  static AbstractTable getTable(AbstractDatasource nds, string nname, *hash<auto> opts);
4097 
4098  static AbstractTable getTable(string dsstr, string nname, *hash<auto> opts);
4099 
4100  static AbstractTable getTable(hash<auto> dsh, string nname, *hash<auto> opts);
4101 
4102 protected:
4103  getColumnsUnlocked();
4104 public:
4105 
4106 
4107 protected:
4108  getPrimaryKeyUnlocked();
4109 public:
4110 
4111 
4112  // also loads primary key and constraints (for unique constraints)
4113 protected:
4114  getIndexesUnlocked();
4115 public:
4116 
4117 
4118 protected:
4119  getForeignConstraintsUnlocked(*hash<auto> opt);
4120 public:
4121 
4122 
4123 protected:
4124  addSourceConstraint(string table_name, AbstractForeignConstraint fk);
4125 public:
4126 
4127 
4128 protected:
4129  getConstraintsUnlocked();
4130 public:
4131 
4132 
4133 protected:
4134  getTriggersUnlocked();
4135 public:
4136 
4137 
4139 protected:
4141 public:
4142 
4143 
4144 protected:
4145  softlist<auto> getDropSqlImpl();
4146 public:
4147 
4148 
4149 protected:
4150  string getTruncateSqlImpl();
4151 public:
4152 
4153 
4155 protected:
4156  auto tryExecArgsImpl(string sql, *softlist<auto> args);
4157 public:
4158 
4159 
4161 protected:
4162  auto tryExecRawImpl(string sql);
4163 public:
4164 
4165 
4167 protected:
4169 public:
4170 
4171 
4172 protected:
4173  preSetupTableImpl(reference desc, *hash<auto> opt);
4174 public:
4175 
4176 
4178 
4180 protected:
4181  abstract AbstractDataProviderType getNumericTypeImpl(string type_name, bool nullable, *hash<auto> options);
4182 public:
4183 
4184 protected:
4185  abstract *hash<auto> doReturningImpl(hash<auto> opt, reference<string> sql, list<auto> args);
4186 public:
4187 
4188 protected:
4189  abstract bool emptyImpl();
4190 public:
4191 
4193 protected:
4194  abstract *string getSqlValueImpl(auto v);
4195 public:
4196 
4198 
4201 protected:
4202  abstract bool checkExistenceImpl();
4203 public:
4204 
4206 protected:
4207  abstract bool supportsTablespacesImpl();
4208 public:
4209 
4211 protected:
4213 public:
4214 
4216 protected:
4218 public:
4219 
4220 protected:
4221  abstract setupTableImpl(hash<auto> desc, *hash<auto> opt);
4222 public:
4223 
4224 protected:
4225  abstract Columns describeImpl();
4226 public:
4227 protected:
4228  abstract AbstractPrimaryKey getPrimaryKeyImpl();
4229 public:
4230 protected:
4231  abstract Indexes getIndexesImpl();
4232 public:
4233 protected:
4234  abstract ForeignConstraints getForeignConstraintsImpl(*hash<auto> opt);
4235 public:
4236 protected:
4237  abstract Constraints getConstraintsImpl();
4238 public:
4239 protected:
4240  abstract Triggers getTriggersImpl();
4241 public:
4242 
4243 protected:
4244  abstract string getCreateTableSqlImpl(*hash<auto> opt);
4245 public:
4246 protected:
4247  abstract *list<auto> getCreateMiscSqlImpl(*hash<auto> opt, bool cache);
4248 public:
4249 protected:
4250  abstract string getCreateSqlImpl(list<auto> l);
4251 public:
4252 protected:
4253  abstract string getRenameSqlImpl(string new_name);
4254 public:
4255 protected:
4256  abstract *list<auto> getAlignSqlImpl(AbstractTable t, *hash<auto> opt);
4257 public:
4258 
4259 protected:
4260  abstract AbstractColumn addColumnImpl(string cname, hash<auto> opt, bool nullable = True);
4261 public:
4262 protected:
4263  abstract AbstractPrimaryKey addPrimaryKeyImpl(string cname, hash<auto> ch, *hash<auto> opt);
4264 public:
4265 protected:
4266  abstract AbstractIndex addIndexImpl(string iname, bool enabled, hash<auto> ch, *hash<auto> opt);
4267 public:
4268 protected:
4269  abstract AbstractForeignConstraint addForeignConstraintImpl(string cname, hash<auto> ch, string table, hash<auto> tch, *hash<auto> opt);
4270 public:
4271 protected:
4272  abstract AbstractCheckConstraint addCheckConstraintImpl(string cname, string src, *hash<auto> opt);
4273 public:
4274 protected:
4275  abstract AbstractUniqueConstraint addUniqueConstraintImpl(string cname, hash<auto> ch, *hash<auto> opt);
4276 public:
4277 
4278 protected:
4279  abstract AbstractTrigger addTriggerImpl(string tname, string src, *hash<auto> opt);
4280 public:
4281 
4283 protected:
4284  abstract bool tryInsertImpl(string sql, hash<auto> row);
4285 public:
4286 
4288 protected:
4289  abstract hash<auto> getQoreTypeMapImpl();
4290 public:
4291 
4293 protected:
4294  abstract hash<auto> getTypeMapImpl();
4295 public:
4296 
4298 protected:
4299  abstract doSelectOrderByWithOffsetSqlUnlockedImpl(reference<hash<QueryInfo>> info, reference<string> sql, list<auto> coll);
4300 public:
4301 
4303 protected:
4304  abstract doSelectLimitOnlyUnlockedImpl(reference<hash<QueryInfo>> info, reference<string> sql);
4305 public:
4306 
4308 protected:
4309  abstract copyImpl(AbstractTable old);
4310 public:
4311 
4313 
4317 protected:
4319 public:
4320 
4322 
4324 protected:
4325  abstract bool isDuplicateRowErrorImpl(hash<ExceptionInfo> ex);
4326 public:
4327 };
4328 };
abstract class for check constraints
Definition: SqlUtil.qm.dox.h:6738
the base class for column information
Definition: SqlUtil.qm.dox.h:6368
the API for a constraint with columns
Definition: SqlUtil.qm.dox.h:6791
abstract base class for constraints
Definition: SqlUtil.qm.dox.h:6676
const CreationOptions
default generic creation options
Definition: AbstractDatabase.qc.dox.h:118
the base class for foreign key constraint information
Definition: SqlUtil.qm.dox.h:6951
the abstract base class for index information
Definition: SqlUtil.qm.dox.h:6546
represents a primary key
Definition: SqlUtil.qm.dox.h:6874
Abstract base class for savepoint helpers for epheremal transaction support.
Definition: AbstractSavepointHelper.qc.dox.h:33
base class for abstract SqlUtil classes
Definition: AbstractSqlUtilBase.qc.dox.h:28
transient Mutex l()
mutex for atomic actions
*hash< auto > opts
option hash
Definition: AbstractSqlUtilBase.qc.dox.h:35
the base abstract class for the table implementation
Definition: AbstractTable.qc.dox.h:30
abstract bool constraintsLinkedToIndexesImpl()
returns True if the database links constraints to indexes (ie dropping the constraint drops the index...
const TableOptions
table options
Definition: AbstractTable.qc.dox.h:41
dropCommit(*hash< auto > opt)
drops the table from the database; releases the transaction lock after dropping the table
bool isDuplicateRowError(hash< ExceptionInfo > ex)
Returns True if the exception was raised because of a duplicate row / key error.
*list< auto > selectRows(*hash< auto > sh, *hash< auto > opt)
returns a list of hashes representing the rows in the table that match the argument hash
auto tryExecRawImpl(string sql)
tries to execute a command so that if an error occurs the current transaction status is not lost
int del(hash< auto > cond, reference< string > sql)
SqlUtil::AbstractTable::del() variant
AbstractColumn modifyColumn(string cname, hash< auto > opt, bool nullable=True, *reference lsql)
modifies an existing column in the table; if the table is already known to be in the database,...
constructor(AbstractDatasource nds, string nname, *hash nopts)
creates the object; private constructor
AbstractPrimaryKey dropPrimaryKey(*reference lsql)
drops the primary key from the table; if the table is known to be in the database already,...
abstract AbstractDataProviderType getNumericTypeImpl(string type_name, bool nullable, *hash< auto > options)
returns the type for number / numeric columns for the database so that data conversions can be handle...
softint rowCount()
returns the number of rows in the table
abstract *string getSqlValueImpl(auto v)
returns a string for use in SQL queries representing the DB-specific value of the argument; returns N...
const ColumnOptions
Column options; this is currently empty and can be extended in database-specific modules.
Definition: AbstractTable.qc.dox.h:192
hash< auto > getIndexOptions()
returns the index options for this driver
*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
hash< auto > getColumnDescOptions()
returns the column description options for this driver
Columns describe()
returns an object of class Columns describing the table
const TableOmissionOptions
alignment omission options
Definition: AbstractTable.qc.dox.h:103
addCustomCopOperator(string name, hash< auto > operator)
register custom user column operator for this table object
list< auto > getDropPrimaryKeySql(*hash< auto > opt)
gets a list of SQL strings that can be used to drop the primary key from the table
int insertFromSelectCommit(list cols, AbstractTable source, hash< auto > sh, hash< auto > opt)
SqlUtil::AbstractTable::insertFromSelectCommit() variant
list< auto > getDropTriggerSql(string tname, *hash< auto > opt)
returns SQL that can be used to drop the given trigger from the table
bool hasReturningImpl()
returns True if the current database driver supports the "returning" clause in insert statements,...
abstract bool checkExistenceImpl()
returns True if the table exists in the DB, False if not
*hash< auto > insertCommit(hash< auto > row, reference< string > sql, hash< auto > opt)
SqlUtil::AbstractTable::insertCommit() variant
AbstractConstraint renameConstraint(string old_name, string new_name, reference lsql)
renames an existing constraint; this can be any constraint on the table, a primary key,...
abstract doSelectLimitOnlyUnlockedImpl(reference< hash< QueryInfo >> info, reference< string > sql)
processes a string for use in SQL select statements when there is a "limit" argument,...
rename(string new_name, *reference< string > sql, *Tables table_cache)
renames the table
deprecated *hash< auto > insertNoCommit(hash< auto > row, *reference< string > sql, *hash< auto > opt)
A legacy wrapper for SqlUtil::AbstractTable::insert()
setupTable(hash< auto > desc, *hash< auto > opt)
creates the object from a table description hash
AbstractDataField getColumnDataField(string column_name, *hash< auto > options, *string append_desc)
returns a field object for the given column
copy(AbstractTable old)
copies the object
int del(hash< auto > cond)
SqlUtil::AbstractTable::del() variant
*hash< auto > insert(hash< auto > row)
inserts a row into the table without any transaction management; a transaction will be in progress af...
int upsertCommit(hash< auto > row, int upsert_strategy=UpsertAuto, *hash< auto > opt)
update or insert the data in the table according to the hash argument; the table must have a unique k...
AbstractColumn dropColumn(string cname, *reference lsql)
drops a column from the table
string getDropIndexSql(string iname, *hash< auto > opt)
gets the SQL that can be used to drop an index from the table
deprecated dropNoCommit(*hash< auto > opt)
A legacy wrapper for drop()
Constraints constraints
constraint descriptions
Definition: AbstractTable.qc.dox.h:391
deprecated createNoCommit(*hash< auto > opt)
A legacy wrapper for create()
Qore::SQL::AbstractSQLStatement getStatement(*hash< auto > sh, *reference< string > sql, *hash< auto > opt)
returns an AbstractSQLStatement object that will iterate the results of a select statement matching t...
softlist< auto > getDropSql(*hash< auto > opt)
returns the sql required to drop the table; reimplement in subclasses if necessary
int insertFromSelect(list cols, AbstractTable source)
SqlUtil::AbstractTable::insertFromSelectCommit() variant
string getDesc()
returns a descriptive string of the datasource (without the password) and the table name (with a poss...
const UpsertResultLetterMap
maps upsert result codes to single letter symbols
Definition: AbstractTable.qc.dox.h:371
AbstractPrimaryKey getPrimaryKey()
returns an object of class AbstractPrimaryKey describing the primary key of the table
int insertFromSelectCommit(list cols, AbstractTable source)
SqlUtil::AbstractTable::insertFromSelectCommit() variant
const UpsertOptions
default upsert option keys
Definition: AbstractTable.qc.dox.h:225
list< auto > getModifyColumnSql(string cname, hash< auto > 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
*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
int update(hash< auto > set, hash< auto > cond)
A SqlUtil::AbstractTable::update() variant.
auto tryExecArgs(string sql, *softlist< auto > args)
executes some SQL with optional arguments so that if an error occurs the current transaction state is...
*list< auto > getCreateTriggersSql(*hash< auto > opt, bool cache=True)
returns a list of SQL strings that could be used to create triggers on the table or NOTHING if there ...
int delCommit()
SqlUtil::AbstractTable::delCommit() variant
hash< auto > getInsertOptions()
returns the insert options for this driver
*hash< string, int > upsertFromSelectCommit(Table t, *hash< auto > sh, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
SqlUtil::AbstractTable::upsertFromSelectCommit() variant
Qore::SQL::AbstractSQLStatement getStatementNoExec(*hash< auto > sh, *reference< string > sql, *hash< auto > opt)
returns an AbstractSQLStatement object that will iterate the results of a select statement matching t...
hash< auto > getSqlDataCallbackOptions()
returns the sql data operation callback options for this driver
AbstractUniqueConstraint addUniqueConstraint(string cname, softlist cols, *hash< auto > opt, *reference< string > sql)
adds a unique constraint to the table; if the table is known to be in the database already,...
hash< auto > getTableCreationOptions()
returns the table creation options for this driver
hash< auto > getUpdateOperatorMap()
returns the update operator map for this object
*list< auto > selectRows(*hash< auto > sh, *reference< string > sql, *hash< auto > opt)
returns a list of hashes representing the rows in the table that match the argument hash
AbstractColumn addColumn(string cname, hash< auto > opt, bool nullable=True, *reference lsql)
adds a column to the table; if the table is already known to be in the database, then it is added in ...
int update(hash< auto > set, hash< auto > 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...
list< auto > getAddColumnSql(string cname, hash< auto > copt, bool nullable=True, *hash< auto > opt)
returns a list of SQL strings that can be use to add a column to the table
string getSqlName()
returns the name of the table to be used in SQL (with a possible qualifier for schema,...
const ColumnDescOptions
Column description options.
Definition: AbstractTable.qc.dox.h:171
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
*hash< string, int > 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...
Qore::SQL::AbstractSQLStatement getStatementNoExec(*hash< auto > sh, *hash< auto > opt)
returns an AbstractSQLStatement object that will iterate the results of a select statement matching t...
list< auto > getCreateSql(*hash< auto > opt)
returns a list of SQL strings that could be used to create the table and all known properties of the ...
bool inDb
in database
Definition: AbstractTable.qc.dox.h:397
hash< auto > getTableDescriptionHashOptions()
returns the table description hash<auto> options for this driver
int update(hash< auto > set, hash< auto > cond, reference< string > sql)
A SqlUtil::AbstractTable::update() variant.
string name
the table's name
Definition: AbstractTable.qc.dox.h:381
deprecated *hash< string, int > upsertFromSelectNoCommit(AbstractTable t, *hash< auto > sh, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
A legacy SqlUtil::AbstractTable::upsertFromSelect() wrapper.
hash< SqlResultInfo > delWithInfo(hash< auto > cond, *hash< auto > opt)
deletes rows in the table matching the condition and returns the count of rows deleted; no transactio...
const IndexOptions
default index options
Definition: AbstractTable.qc.dox.h:52
deprecated *hash< string, int > upsertFromSelect(Table t, *hash< auto > sh, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
SqlUtil::AbstractTable::upsertFromSelect() variant
hash< SqlResultInfo > getStatementNoExecWithInfo(*hash< auto > select_hash, *hash< auto > opt)
returns a result hash including an AbstractSQLStatement object that will iterate the results of a sel...
hash< SqlResultInfo > selectWithInfo(*hash< auto > select_hash, *hash< auto > opt)
returns a hash with a result key assigned to a hash of lists representing the columns and rows in the...
string getCreateTableSql(*hash< auto > opt)
returns an SQL string that could be used to create the basic table structure without indexes and cons...
*hash find(auto id)
finds a row in the table with the given primary key value; if no row matches the primary key value pa...
hash< SqlResultInfo > updateWithInfo(hash< auto > set, hash< auto > cond, *hash< auto > opt)
updates rows in the table matching an optional condition and returns an info hash with the count of r...
string getAddCheckConstraintSql(string cname, string src, *hash copt, *hash< auto > opt)
returns an SQL string that can be used to add a check constraint to the table
*list< auto > getCreateConstraintsSql(*hash< auto > opt, bool cache=True)
returns a list of SQL strings that could be used to create non-foreign constraints on the table or NO...
string getColumnSqlName(string col)
returns the column name for use in SQL strings; subclasses can return a special string in case the co...
hash< SqlResultInfo > insertWithInfo(hash< auto > row, *hash< auto > opt)
Inserts a row and returns the result and also the SQL used.
AbstractIndex addIndex(string iname, bool unique, softlist cols, *hash< auto > opt, *reference< string > sql)
adds an index to the table; if the table is already known to be in the database, then it is added in ...
bool hasReturning()
returns True if the current database driver supports the "returning" clause in insert statements,...
code getUpsertClosureWithValidation(hash< auto > 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...
hash< auto > getUpsertOptions()
returns the upsert options for this driver
string getDropConstraintSql(string cname, *hash< auto > opt)
gets the SQL that can be used to drop a constraint from the table; this can be any constraint on the ...
deprecated int upsertNoCommit(hash< auto > row, int upsert_strategy=UpsertAuto)
A legacy SqlUtil::AbstractTable::upsert() wrapper.
bool bindEmptyStringsAsNull()
returns True if the DB treats empty strings as NULL, False if not; by default this method returns Fal...
hash< auto > getWhereOperatorMap()
returns the "where" operator map for this object
list< auto > getDropAllConstraintsAndIndexesOnColumnSql(string cname, *hash< auto > opt)
gets a list of SQL strings to drop all constraints and indexes with the given column name; if the col...
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
hash< SqlResultInfo > selectRowWithInfo(*hash< auto > select_hash, *hash< auto > opt)
returns a hash with a result representing the row in the table that matches the argument hash; if mor...
const SqlDataCallbackOptions
generic SQL data operation callbacks
Definition: AbstractTable.qc.dox.h:199
hash< SqlCommandInfo > getUpdateSql(hash< auto > set, *hash< auto > cond)
Returns the SQL for the given update parameters.
auto tryExec(string sql)
executes some SQL with optional arguments so that if an error occurs the current transaction state is...
hash< auto > getInsertOperatorMap()
returns the insert operator map for this object
hash< auto > getCacheOptions()
returns the cache options for this driver
*hash< auto > insertCommit(hash< auto > row, reference< string > sql)
SqlUtil::AbstractTable::insertCommit() variant
const InsertOptions
generic SQL insert options
Definition: AbstractTable.qc.dox.h:214
*hash< string, int > 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...
AbstractDataField getColumnDataField(AbstractColumn column, *hash< SqlUtilDataTypeOptionInfo > options, *string append_desc)
returns a field object for the given column
deprecated int insertFromIteratorNoCommit(Qore::AbstractIterator i, *hash< auto > opt)
A legacy SqlUtil::AbstractTable::insertFromIterator() wrapper.
*list< auto > getCreateMiscSql(*hash< auto > opt, bool cache=True)
returns a list of SQL strings that could be used to create other table attributes (such as comments,...
abstract bool isDuplicateRowErrorImpl(hash< ExceptionInfo > ex)
Returns True if the exception was raised because of a duplicate row / key error.
AbstractIndex renameIndex(string old_name, string new_name, reference< string > sql)
renames an existing index; if the table is already known to be in the database, then the changes are ...
int delCommit(hash< auto > cond, reference< string > sql, hash< auto > opt)
deletes rows in the table matching the condition and returns the count of rows deleted; the transacti...
hash< string, Columns > getAllUpsertColumns(*hash< auto > row)
returns a hash with a single value\
int delCommit(hash< auto > cond, hash< auto > opt)
SqlUtil::AbstractTable::delCommit() variant
abstract copyImpl(AbstractTable old)
db-specific copy actions
AbstractConstraint dropConstraint(string cname, *reference< string > sql)
drops a constraint from the table; this can be any constraint on the table, a primary key,...
string getRenameSql(string new_name, *hash< auto > opt)
returns an SQL string that could be used to rename the table in the database
*hash< auto > getColumnOperatorMapImpl()
Reimplement in subclasses to provide driver specific column operators.
int delCommit(hash< auto > cond)
SqlUtil::AbstractTable::delCommit() variant
*hash< string, AbstractDataField > getRecordType()
returns a record description for the table
*hash< auto > insert(hash< auto > row, hash< auto > opt)
SqlUtil::AbstractTable::insert() variant
auto tryExecArgsImpl(string sql, *softlist< auto > args)
tries to execute a command so that if an error occurs the current transaction status is not lost
AbstractForeignConstraint removeForeignConstraint(string cname)
removes the named foreign constraint from the table; no SQL is executed in any case,...
const CacheOptions
default cache options
Definition: AbstractTable.qc.dox.h:63
string getAddIndexSql(string iname, bool unique, softlist cols, *hash< auto > ixopt, *hash< auto > opt)
returns an SQL string that can be used to add an index to the table
bool native_case
native case option
Definition: AbstractTable.qc.dox.h:395
int insertFromIterator(Qore::AbstractIterator i, *hash< auto > opt)
this method inserts data from the given iterator argument (whose getValue() method must return a hash...
code getUpsertClosure(hash< auto > row, int upsert_strategy=UpsertAuto, *hash< auto > opt)
returns a closure that can be executed given a hash argument representing a single row that will be u...
hash< auto > getInsertFromIteratorOptions()
returns the insert from iterator options for this driver
int insertFromSelectCommit(list cols, AbstractTable source, hash< auto > sh, reference< string > sql)
SqlUtil::AbstractTable::insertFromSelectCommit() variant
bool asteriskRequiresPrefix()
returns True if the database requires a wildcard "*" to be prefixed with the table name when it appea...
bool emptyData()
returns True if the table has no data rows, False if not
int updateCommit(hash< auto > set, hash< auto > cond, hash< auto > opt)
A SqlUtil::AbstractTable::updateCommit() variant.
*hash< auto > findSingle(*hash< auto > cond)
finds a single row in the table that match the row condition passed; multiple rows may match,...
drop(*hash< auto > opt)
drops the table from the database without any transaction management
AbstractDataProviderType getNumericType(string type_name, bool nullable, *hash< auto > options)
returns the type for number / numeric columns for the database so that data conversions can be handle...
deprecated int insertFromSelectNoCommit(list cols, AbstractTable source, *hash< auto > sh, *reference< string > sql, *hash< auto > opt)
A legacy SqlUtil::AbstractTable::insertFromSelect() wrapper.
abstract bool uniqueIndexCreatesConstraintImpl()
returns True if the database automatically creates a unique constraint when a unique index is created...
abstract hash< auto > getTypeMapImpl()
returns the type name -> type description hash
int updateCommit(hash< auto > set, hash< auto > cond)
A SqlUtil::AbstractTable::updateCommit() variant.
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...
deprecated int updateNoCommit(hash< auto > set, *hash< auto > cond, *hash< auto > opt)
A legacy SqlUtil::AbstractTable::update() wrapper.
Columns columns
column description object
Definition: AbstractTable.qc.dox.h:383
Indexes getIndexes()
returns an object of class Indexes describing the indexes on the table
list< auto > getAddTriggerSql(string tname, string src, *hash topt, *hash< auto > opt)
returns a list of SQL strings that can be used to add a trigger to the table
*string getCreatePrimaryKeySql(*hash< auto > opt, bool cache=True)
returns an SQL string that could be used to create the primary key on the table
*list< auto > getCreateIndexesSql(*hash< auto > opt, bool cache=True)
returns a list of SQL strings that could be used to create indexes on the table or NOTHING if there a...
hash< auto > getConstraintOptions()
returns the constraint options for this driver
string getName()
returns the name of the table
*hash< auto > select(*hash< auto > sh, *reference< string > sql, *hash< auto > opt)
returns a hash of lists representing the columns and rows in the table that match the argument hash
AbstractForeignConstraint dropForeignConstraint(string cname, *reference< string > sql)
drops a foreign constraint from the table; if the table is known to be in the database already,...
*hash< auto > find(hash< auto > row)
finds a row in the table with the given primary key value given as a hash; if no row matches the prim...
Triggers getTriggers()
returns an object of class Triggers describing the triggers on the table
*hash< auto > selectRow(*hash< auto > sh, *hash< auto > opt)
returns a hash representing the row in the table that matches the argument hash; if more than one row...
Qore::SQL::AbstractSQLStatement getStatement(*hash< auto > sh, *hash< auto > opt)
returns an AbstractSQLStatement object that will iterate the results of a select statement matching t...
deprecated *hash< string, int > upsertFromIteratorNoCommit(Qore::AbstractIterator i, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
A legacy SqlUtik::AbstractTable::upsertFromIterator() wrapper.
list< auto > getColumnSqlNames(softlist cols)
returns a list of column names for use in SQL strings; subclasses can process the argument list in ca...
ForeignConstraints foreignConstraints
foreign constraints description
Definition: AbstractTable.qc.dox.h:389
clearImpl()
clears any driver-specific table information
*hash< auto > insertCommit(hash< auto > row, hash< auto > opt)
SqlUtil::AbstractTable::insertCommit() variant
const SelectOptions
default possible select options; can be extended by driver-specific modules
Definition: AbstractTable.qc.dox.h:85
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...
int del(hash< auto > cond, hash< auto > opt)
SqlUtil::AbstractTable::del() variant
setDatasource(AbstractDatasource nds)
changes the datasource for the table; if the inDb flag is True, then it is set to False by calling th...
Qore::SQL::SQLStatement getRowIterator(*hash< auto > sh, *reference< string > sql, *hash< auto > opt)
returns an SQLStatement object that will iterate the results of a select statement matching the argum...
cache(*hash< auto > opts)
reads in all attributes of the table from the database
truncateCommit()
truncates all the table data; releases the transaction lock after executing
*hash< string, int > upsertFromSelectCommit(AbstractTable t, *hash< auto > sh, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
Upserts or merges data from the given foreign table and select option hash into the current table.
deprecated int updateNoCommit(hash< auto > set, *hash< auto > cond, *reference< string > sql)
A legacy SqlUtil::AbstractTable::update() wrapper.
int insertFromIteratorCommit(Qore::AbstractIterator i, *hash< auto > opt)
this method inserts data from the given iterator argument (whose getValue() method must return a hash...
int del(hash< auto > cond, reference< string > sql, hash< auto > opt)
deletes rows in the table matching the condition and returns the count of rows deleted; no transactio...
hash< auto > getForeignConstraintOptions()
return the foreign constraint options for this driver
const ConstraintOptions
default constraint options
Definition: AbstractTable.qc.dox.h:60
createCommit(*hash< auto > opt)
creates the table in the database; releases the transaction lock after creating the table
string getBaseType()
returns the base type of the underlying object (normally "table", some DB-specific implementations ma...
deprecated *hash< auto > insertNoCommit(hash< auto > row, hash< auto > opt)
A legacy wrapper for SqlUtil::AbstractTable::insert()
const TableDescriptionHashOptions
Table description options.
Definition: AbstractTable.qc.dox.h:147
int update(hash< auto > set)
A SqlUtil::AbstractTable::update() variant.
int update(hash< auto > set, hash< auto > cond, hash< auto > opt)
A SqlUtil::AbstractTable::update() variant.
clear()
purges the current table definition
hash< auto > getColumnOptions()
returns the column options for this driver
list< auto > getAlignSql(AbstractTable t, *hash< auto > opt)
returns a list of SQL strings required to align the table to the table given as an argument
const UpsertResultDescriptionMap
hash mapping upsert descriptions to codes
Definition: AbstractTable.qc.dox.h:362
int updateCommit(hash< auto > set, hash< auto > cond, reference< string > sql)
A SqlUtil::AbstractTable::updateCommit() variant.
*hash< string, int > 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...
hash< auto > getTableColumnDescOptions()
returns the table column description options for this driver
*hash< auto > getPseudoColumnHash()
returns a hash of valid pseudocolumns
string getAddPrimaryKeySql(string pkname, softlist cols, *hash pkopt, *hash< auto > opt)
returns the SQL that can be used to add a primary key to the table
int updateCommit(hash< auto > set, hash< auto > 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...
*hash< auto > insert(hash< auto > row, reference< string > sql, hash< auto > opt)
SqlUtil::AbstractTable::insert() variant
Constraints getConstraints()
returns a Constraints object describing the non-foreign constraints on the table
abstract bool hasArrayBind()
returns True if the underlying DB driver supports bulk DML operations
validateColumnOptions(string cname, reference< hash > opt, bool nullable)
validates column options
deprecated truncateNoCommit()
A legacy warpper for truncate()
hash< auto > getDescriptionHash()
Returns a description hash of the table.
commit()
commits the current transaction on the underlying Qore::SQL::AbstractDatasource
hash< auto > getColumnOperatorMap()
returns the column operator map for this object
hash< auto > getRawUpdateOperatorMap()
returns the raw (default) update operator map for this object
bool checkExistence()
returns True if the table exists in the database, False if not
*list< auto > findAll(*hash< auto > cond)
finds all rows in the table with the given column values; a list of hashes is returned representing t...
int insertFromSelectCommit(list cols, AbstractTable source, hash< auto > sh)
SqlUtil::AbstractTable::insertFromSelectCommit() variant
hash< auto > getExpressionMap()
Returns the expression map for this database server.
AbstractTable getSubtableFromString(string table, *hash< auto > opt)
Returns the given table from the argument, using any "tablecode" option if present.
const TableCreationOptions
table creation options
Definition: AbstractTable.qc.dox.h:113
int delCommit(hash< auto > cond, reference< string > sql)
SqlUtil::AbstractTable::delCommit() variant
int insertFromSelect(list cols, AbstractTable source, hash< auto > sh, reference< string > sql, hash< auto > opt)
inserts rows into a table based on a select statement from another table (which must be using the sam...
Triggers triggers
trigger descriptions
Definition: AbstractTable.qc.dox.h:393
AbstractColumn renameColumn(string old_name, string new_name, reference< string > sql)
renames an existing column; if the table is already known to be in the database, then the changes are...
abstract AbstractSavepointHelper getSavepointHelperImpl(*string savepoint)
get DB-specific savepoint helper
int updateCommit(hash< auto > set)
A SqlUtil::AbstractTable::updateCommit() variant.
AbstractDataProviderType getColumnDataType(string column_name, *hash< SqlUtilDataTypeOptionInfo > options)
returns the data type for the given column
AbstractPrimaryKey primaryKey
primary key description
Definition: AbstractTable.qc.dox.h:385
bool inDb()
returns True if the table has been read from or created in the database, False if not
Qore::SQL::SQLStatement getRowIterator(*hash< auto > sh, *hash< auto > opt)
returns an SQLStatement object that will iterate the results of a select statement matching the argum...
int insertFromSelect(list cols, AbstractTable source, hash< auto > sh, reference< string > sql)
SqlUtil::AbstractTable::insertFromSelectCommit() variant
AbstractIndex dropIndex(string iname, *reference< string > sql)
drops the given index from the table; if the table is known to be in the database already,...
hash< auto > getTableOptions()
returns the table options for this driver
list< auto > getDropColumnSql(string cname, *hash< auto > opt)
returns the SQL that can be used to drop a column from the table
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,...
deprecated *hash< string, int > upsertFromSelectNoCommit(Table t, *hash< auto > sh, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
A legacy SqlUtil::AbstractTable::upsertFromSelect() wrapper.
hash< auto > getAlignTableOptions()
returns the align table options for this driver
AbstractPrimaryKey addPrimaryKey(string pkname, softlist cols, *hash< auto > opt, *reference< string > sql)
adds a primary key to the table; if the table is already known to be in the database,...
beginTransaction()
begins a transaction on the underlying Qore::SQL::AbstractDatasource
hash< SqlResultInfo > selectRowsWithInfo(*hash< auto > select_hash, *hash< auto > opt)
returns a hash with a result key assigned to a list of hashes representing the rows in the table that...
abstract bool supportsTablespacesImpl()
returns True if the database support tablespaces
hash< auto > getSelectOptions()
returns the select options for this driver
hash< SqlResultInfo > getStatementWithInfo(*hash< auto > select_hash, *hash< auto > opt)
returns a result hash including an AbstractSQLStatement object that will iterate the results of a sel...
rollback()
rolls back the current transaction on the underlying Qore::SQL::AbstractDatasource
string getTruncateSql(*hash< auto > opt)
gets the SQL that can be used to truncate the table
string getSqlFromList(list< auto > l)
returns an SQL string corresponding to the list of commands in the argument
abstract doSelectOrderByWithOffsetSqlUnlockedImpl(reference< hash< QueryInfo >> info, reference< string > sql, list< auto > coll)
processes a string for use in SQL select statements when there is an "order by" and "offset" argument
*hash< auto > insert(hash< auto > row, reference< string > sql)
SqlUtil::AbstractTable::insert() variant
string getRenameColumnSql(string old_name, string new_name, *hash< auto > opt)
gets an SQL string that can be used to rename an existing column in the table
hash< auto > getTriggerOptions()
returns the trigger options for this driver
AbstractCheckConstraint addCheckConstraint(string cname, string src, *hash< auto > opt, *reference< string > sql)
adds a check constraint to the table; if the table is already known to be in the database,...
ForeignConstraints getForeignConstraints(*hash< auto > opt)
returns a ForeignConstraints object describing the foreign constraints that the table has on other ta...
string getSqlValue(auto v)
returns a string for use in SQL queries representing the DB-specific value of the argument
const TriggerOptions
default trigger options
Definition: AbstractTable.qc.dox.h:79
const AlignTableOptions
table alignment options
Definition: AbstractTable.qc.dox.h:126
int insertFromSelect(list cols, AbstractTable source, hash< auto > sh, hash< auto > opt)
SqlUtil::AbstractTable::insertFromSelectCommit() variant
code getBulkUpsertClosure(hash< auto > 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...
auto tryExecRaw(string sql)
executes some SQL so that if an error occurs the current transaction state is not lost
*AbstractUniqueConstraint findUniqueConstraint(string name)
returns the given AbstractUniqueConstraint object if defined for the table (also includes the primary...
abstract hash< auto > getQoreTypeMapImpl()
returns the qore type -> column type map
string getCreateSqlString(*hash< auto > opt)
returns an SQL string that could be used to create the table and all known properties of the table
int del()
SqlUtil::AbstractTable::del() variant
const UpsertResultMap
hash mapping upsert results to a description
Definition: AbstractTable.qc.dox.h:351
AbstractSavepointHelper getSavepointHelper(*string savepoint)
get DB-specific savepoint helper
truncate()
truncates all the table data without any transaction management
AbstractTrigger dropTrigger(string tname, *reference< string > sql)
drops the given trigger from the table; if the table is known to be in the database already,...
AbstractDataProviderType getDbType(AbstractColumn column, *hash< SqlUtilDataTypeOptionInfo > options)
returns the DB type for the given column type
*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...
string getAlignSqlString(AbstractTable t, *hash< auto > opt)
accepts an AbstractTable argument and returns an SQL string that could be executed to align the struc...
AbstractTrigger addTrigger(string tname, string src, *hash< auto > opt, *reference lsql)
adds a trigger to the table; if the table is already known to be in the database, then it is added in...
string getSelectSql(*hash< auto > sh, *reference< list< auto >> args)
returns the SQL string to be executed corresponding to the argument hash with an output parameter for...
Qore::SQL::SQLStatement getRowIteratorNoExec(*hash< auto > sh, *reference< string > sql, *hash< auto > opt)
returns an SQLStatement object that will iterate the results of a select statement matching the argum...
bool manual
manual edits
Definition: AbstractTable.qc.dox.h:399
*list find(list< auto > ids)
finds rows in the table with the given primary key values; if no row matches any primary key value pa...
const ForeignConstraintOptions
default foreign constraint options
Definition: AbstractTable.qc.dox.h:72
const AdditionalColumnDescOptions
additional column description keys valid when describing columns in a table description hash
Definition: AbstractTable.qc.dox.h:187
const InsertFromIteratorOptions
default insert option keys
Definition: AbstractTable.qc.dox.h:237
string getAddForeignConstraintSql(string cname, softlist cols, string table, *softlist tcols, *hash fkopt, *hash< auto > opt)
returns an SQL string that can be used to add a foreign constraint to the table
bool empty()
returns True if the table has no definitions, False if not
deprecated int delNoCommit(*hash< auto > cond, *reference< string > sql)
A legacy SqlUtil::AbstractTable::del() wrapper.
Qore::AbstractIterator getUniqueConstraintIterator()
returns an iterator for all unique constraints on the table (including the primary key if any)
hash< SqlResultInfo > insertFromSelectWithInfo(list< auto > cols, AbstractTable source, hash< auto > select_hash, *hash< auto > opt)
inserts rows into a table based on a select statement from another table (which must be using the sam...
*list< auto > getCreateForeignConstraintsSql(*hash< auto > opt, bool cache=True)
returns a list of SQL strings that could be used to create foreign constraints on the table or NOTHIN...
Indexes indexes
index descriptions
Definition: AbstractTable.qc.dox.h:387
*hash< auto > insertCommit(hash< auto > row)
inserts a row into the table; the transaction is committed if successful, if an error occurs,...
int insertFromSelect(list cols, AbstractTable source, hash< auto > sh)
SqlUtil::AbstractTable::insertFromSelectCommit() variant
abstract bool tryInsertImpl(string sql, hash< auto > row)
tries to insert a row, if there is a duplicate key, then it returns False, if successful,...
create(*hash< auto > opt)
creates the table with all associated properties (indexes, constraints, etc) without any transaction ...
the base class for triggers
Definition: SqlUtil.qm.dox.h:7149
represents a unique column constraint
Definition: SqlUtil.qm.dox.h:6865
column container class that throws an exception if an unknown column is accessed
Definition: SqlUtil.qm.dox.h:6286
constraint container class that throws an exception if an unknown constraint is accessed
Definition: SqlUtil.qm.dox.h:6634
foreign constraint container class that throws an exception if an unknown constraint is accessed
Definition: SqlUtil.qm.dox.h:6885
index container class that throws an exception if an unknown index is accessed
Definition: SqlUtil.qm.dox.h:6500
represents a database table; this class embeds an AbstractTable object that is created automatically ...
Definition: Table.qc.dox.h:44
the table container class stores a collection of tables in a schema
Definition: SqlUtil.qm.dox.h:6098
trigger container class that throws an exception if an unknown trigger is accessed
Definition: SqlUtil.qm.dox.h:7167
const True
const False
const NothingType
const Hash
const String
const Boolean
const Int
hash< auto > hash(object obj)
string type(auto arg)
list< auto > list(...)
const UpsertUpdateFirst
Upsert option: update first, if the update fails, then insert.
Definition: AbstractTable.qc.dox.h:271
const UpsertStrategyMap
hash mapping upsert strategy codes to a text description
Definition: AbstractTable.qc.dox.h:306
const UpsertInsertOnly
Upsert option: insert if the row does not exist, otherwise ignore.
Definition: AbstractTable.qc.dox.h:294
const UpsertInsertFirst
Definition: AbstractTable.qc.dox.h:263
const UpsertUpdateOnly
Upsert option: update if the row exists, otherwise ignore.
Definition: AbstractTable.qc.dox.h:301
const UpsertAuto
Upsert option: if the target table is empty, use UpsertInsertFirst, otherwise use UpsertUpdateFirst.
Definition: AbstractTable.qc.dox.h:287
const UpsertStrategyDescriptionMap
hash mapping upsert strategy descriptions to upsert strategy codes
Definition: AbstractTable.qc.dox.h:318
const UpsertSelectFirst
Upsert option: select first, if the row is unchanged, do nothing, if it doesn't exist,...
Definition: AbstractTable.qc.dox.h:280
const UR_Updated
row was updated because it was different (only possible with UpsertSelectFirst)
Definition: AbstractTable.qc.dox.h:339
const UR_Verified
row was updated unconditionally (not returned with UpsertSelectFirst)
Definition: AbstractTable.qc.dox.h:336
const UR_Deleted
row was deleted (only possible with batch upsert methods such as AbstractTable::upsertFromIterator() ...
Definition: AbstractTable.qc.dox.h:345
const UR_Inserted
Definition: AbstractTable.qc.dox.h:333
const UR_Unchanged
row was unchanged (only possible with UpsertSelectFirst, UpsertInsertOnly, and UpsertUpdateOnly)
Definition: AbstractTable.qc.dox.h:342
Qore AbstractDatabase class definition.
Definition: AbstractDatabase.qc.dox.h:26