Qore SqlUtil Module Reference  1.6
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  "native_case": Type::Boolean,
46  "table_cache": "Tables",
47  };
48 
50 
54  const IndexOptions = {
55  "index_tablespace": Type::String,
56  "replace": Type::Boolean,
57  };
58 
60 
63 
65  const CacheOptions = {
66  "table_cache": "Tables",
67  };
68 
70 
74  "table_cache": "Tables",
75  };
76 
78 
81 
83 
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 
257 
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 
332  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 
420  copy(AbstractTable old);
421 
422 
424 
435  setDatasource(AbstractDatasource nds);
436 
437 
438 protected:
439  doTableOptions(*hash nopts);
440 public:
441 
442 
444  commit();
445 
446 
448  rollback();
449 
450 
452 
461  bool inDb();
462 
463 
465 
473 
474 
476 
487  dropCommit(*hash<auto> opt);
488 
489 
491 
502  drop(*hash<auto> opt);
503 
504 
506  deprecated dropNoCommit(*hash<auto> opt);
507 
509 
520  auto tryExec(string sql);
521 
522 
524 
534  auto tryExecArgs(string sql, *softlist<auto> args);
535 
536 
538 
549  auto tryExecRaw(string sql);
550 
551 
553 
564  softlist<auto> getDropSql(*hash<auto> opt);
565 
566 
568 
575  truncateCommit();
576 
577 
579 
586  truncate();
587 
588 
590  deprecated truncateNoCommit();
591 
593 
608  string getTruncateSql(*hash<auto> opt);
609 
610 
612 
621  createCommit(*hash<auto> opt);
622 
623 
625 
636  create(*hash<auto> opt);
637 
638 
640  deprecated createNoCommit(*hash<auto> opt);
641 
643 
654  rename(string new_name, *reference<string> sql, *Tables table_cache);
655 
656 
657 protected:
658  doRenameIntern(string new_name, *Tables table_cache);
659 public:
660 
661 
663 
674  bool emptyData();
675 
676 
678 
687  bool empty();
688 
689 
690 protected:
691  bool emptyUnlocked();
692 public:
693 
694 
696 
702  setupTable(hash<auto> desc, *hash<auto> opt);
703 
704 
706 
730  AbstractColumn addColumn(string cname, hash<auto> opt, bool nullable = True, *reference lsql);
731 
732 
734 
763  list<auto> getAddColumnSql(string cname, hash copt, bool nullable = True, *hash<auto> opt);
764 
765 
766 protected:
767  AbstractColumn addColumnUnlocked(string cname, hash<auto> opt, bool nullable = True, *reference lsql, bool do_exec = True, bool modify_table = True);
768 public:
769 
770 
771 protected:
772  addColumnToTableUnlocked(AbstractColumn c);
773 public:
774 
775 
777 
802  AbstractColumn modifyColumn(string cname, hash<auto> opt, bool nullable = True, *reference lsql);
803 
804 
806 
833  list<auto> getModifyColumnSql(string cname, hash copt, bool nullable = True, *hash<auto> opt);
834 
835 
837 
854  AbstractColumn renameColumn(string old_name, string new_name, reference<string> sql);
855 
856 
858 
876  string getRenameColumnSql(string old_name, string new_name, *hash<auto> opt);
877 
878 
879 protected:
880  AbstractColumn renameColumnIntern(AbstractColumn c, string new_name);
881 public:
882 
883 
884 protected:
885  validateOptionsIntern(string err, hash ropt, reference<hash> opt);
886 public:
887 
888 
889 protected:
890  validateOptionsIntern(string err, hash ropt, reference<hash> opt, string tag);
891 public:
892 
893 
894 protected:
895  execSql(softlist lsql);
896 public:
897 
898 
900 
920  AbstractPrimaryKey addPrimaryKey(string pkname, softlist cols, *hash<auto> opt, *reference<string> sql);
921 
922 
924 
946  string getAddPrimaryKeySql(string pkname, softlist cols, *hash pkopt, *hash<auto> opt);
947 
948 
949 protected:
950  setPrimaryKeyUnlocked(AbstractPrimaryKey pk);
951 public:
952 
953 
954 protected:
955  AbstractPrimaryKey addPrimaryKeyUnlocked(string pkname, softlist cols, *hash<auto> opt, *reference<string> sql);
956 public:
957 
958 
959 protected:
960  AbstractPrimaryKey addPrimaryKeyUnlockedIntern(string pkname, softlist cols, *hash<auto> opt, *reference<string> sql);
961 public:
962 
963 
965 
981  list<auto> getDropAllConstraintsAndIndexesOnColumnSql(string cname, *hash<auto> opt);
982 
983 
984 protected:
985  list<auto> getDropAllConstraintsAndIndexesOnColumnSqlUnlocked(string cname, *hash<auto> opt);
986 public:
987 
988 
990 
1009  list<auto> getDropPrimaryKeySql(*hash<auto> opt);
1010 
1011 
1013 
1031  AbstractPrimaryKey dropPrimaryKey(*reference lsql);
1032 
1033 
1035 
1056  AbstractUniqueConstraint addUniqueConstraint(string cname, softlist cols, *hash<auto> opt, *reference<string> sql);
1057 
1058 
1060 
1080  string getAddUniqueConstraintSql(string cname, softlist cols, *hash ukopt, *hash<auto> opt);
1081 
1082 
1083 protected:
1084  AbstractUniqueConstraint addUniqueConstraintUnlocked(string cname, softlist cols, *hash<auto> opt, *reference<string> sql);
1085 public:
1086 
1087 
1088 protected:
1089  AbstractUniqueConstraint addUniqueConstraintUnlockedIntern(string cname, softlist cols, *hash<auto> opt, *reference<string> sql);
1090 public:
1091 
1092 
1094 
1115  AbstractIndex addIndex(string iname, bool unique, softlist cols, *hash<auto> opt, *reference<string> sql);
1116 
1117 
1119 
1140  string getAddIndexSql(string iname, bool unique, softlist cols, *hash<auto> ixopt, *hash<auto> opt);
1141 
1142 
1143 protected:
1144  AbstractIndex addIndexUnlocked(string iname, bool unique, softlist cols, *hash<auto> opt, *reference<string> sql);
1145 public:
1146 
1147 
1148 protected:
1149  AbstractIndex addIndexUnlockedIntern(string iname, bool unique, softlist cols, *hash<auto> opt, *reference<string> sql);
1150 public:
1151 
1152 
1154 
1166  AbstractIndex renameIndex(string old_name, string new_name, reference<string> sql);
1167 
1168 
1170 
1188  AbstractIndex dropIndex(string iname, *reference<string> sql);
1189 
1190 
1192 
1211  string getDropIndexSql(string iname, *hash<auto> opt);
1212 
1213 
1215 
1237  AbstractForeignConstraint addForeignConstraint(string cname, softlist cols, string table, *softlist tcols, *hash<auto> opt, *reference<string> sql);
1238 
1239 
1241 
1263  string getAddForeignConstraintSql(string cname, softlist cols, string table, *softlist tcols, *hash fkopt, *hash<auto> opt);
1264 
1265 
1266 protected:
1267  Columns getReferencedTableColumnsUnlocked(string table, *Tables cache, string err = 'FOREIGN-CONSTRAINT-ERROR');
1268 public:
1269 
1270 
1271 protected:
1272  AbstractForeignConstraint addForeignConstraintUnlocked(string cname, softlist cols, string table, *softlist tcols, *hash<auto> opt, *reference<string> sql);
1273 public:
1274 
1275 
1276 protected:
1277  AbstractForeignConstraint addForeignConstraintUnlockedIntern(string cname, softlist cols, string table, *softlist tcols, *hash<auto> opt, *reference<string> sql);
1278 public:
1279 
1280 
1282 
1300  AbstractForeignConstraint dropForeignConstraint(string cname, *reference<string> sql);
1301 
1302 
1304 
1320 
1321 
1323 
1343  AbstractCheckConstraint addCheckConstraint(string cname, string src, *hash<auto> opt, *reference<string> sql);
1344 
1345 
1347 
1369  string getAddCheckConstraintSql(string cname, string src, *hash copt, *hash<auto> opt);
1370 
1371 
1372 protected:
1373  AbstractCheckConstraint addCheckConstraintUnlocked(string cname, string src, *hash<auto> opt, *reference<string> sql);
1374 public:
1375 
1376 
1377 protected:
1378  AbstractCheckConstraint addCheckConstraintUnlockedIntern(string cname, string src, *hash<auto> opt, *reference<string> sql);
1379 public:
1380 
1381 
1383 
1395  AbstractConstraint renameConstraint(string old_name, string new_name, reference lsql);
1396 
1397 
1399 
1418  string getDropConstraintSql(string cname, *hash<auto> opt);
1419 
1420 
1422 
1441  *string getDropConstraintIfExistsSql(string cname, *hash<auto> opt, *reference<AbstractConstraint> cref);
1442 
1443 
1444 protected:
1445  AbstractConstraint findDropConstraintUnlocked(string cname, reference<code> rmv);
1446 public:
1447 
1448 
1450 
1468  AbstractConstraint dropConstraint(string cname, *reference<string> sql);
1469 
1470 
1472 
1492  AbstractTrigger addTrigger(string tname, string src, *hash<auto> opt, *reference lsql);
1493 
1494 
1496 
1518  list<auto> getAddTriggerSql(string tname, string src, *hash topt, *hash<auto> opt);
1519 
1520 
1521 protected:
1522  AbstractTrigger addTriggerUnlocked(string tname, string src, *hash<auto> opt, *reference lsql);
1523 public:
1524 
1525 
1526 protected:
1527  AbstractTrigger addTriggerUnlockedIntern(string tname, string src, *hash<auto> opt, *reference lsql);
1528 public:
1529 
1530 
1532 
1550  AbstractTrigger dropTrigger(string tname, *reference<string> sql);
1551 
1552 
1554 
1573  list<auto> getDropTriggerSql(string tname, *hash<auto> opt);
1574 
1575 
1576 protected:
1577  getAllConstraintsUnlocked(*hash<auto> opt);
1578 public:
1579 
1580 
1581 protected:
1582  checkUniqueConstraintName(string err, string cname);
1583 public:
1584 
1585 
1586 protected:
1587  checkUniqueConstraintNameValidateOptions(string err, string cname, hash ropt, reference<hash> opt);
1588 public:
1589 
1590 
1592 protected:
1593  validateColumnOptions(string cname, reference<hash> opt, bool nullable);
1594 public:
1595 
1596 
1598 
1616  AbstractColumn dropColumn(string cname, *reference lsql);
1617 
1618 
1620 
1639  list<auto> getDropColumnSql(string cname, *hash<auto> opt);
1640 
1641 
1643 
1654  *hash<auto> insertCommit(hash<auto> row);
1655 
1656 
1658 
1662  *hash<auto> insertCommit(hash<auto> row, reference<string> sql);
1663 
1664 
1666 
1670  *hash<auto> insertCommit(hash<auto> row, hash<auto> opt);
1671 
1672 
1674 
1679  *hash<auto> insertCommit(hash<auto> row, reference<string> sql, hash<auto> opt);
1680 
1681 
1683 
1695  *hash<auto> insert(hash<auto> row);
1696 
1697 
1699 
1703  *hash<auto> insert(hash<auto> row, reference<string> sql);
1704 
1705 
1707 
1711  *hash<auto> insert(hash<auto> row, hash<auto> opt);
1712 
1713 
1715 
1720  *hash<auto> insert(hash<auto> row, reference<string> sql, hash<auto> opt);
1721 
1722 
1724  deprecated *hash<auto> insertNoCommit(hash<auto> row, *reference<string> sql, *hash<auto> opt);
1725 
1727  deprecated *hash<auto> insertNoCommit(hash<auto> row, hash<auto> opt);
1728 
1729 protected:
1730  *hash<auto> insertIntern(hash<auto> row, *reference<string> sql, *hash<auto> opt);
1731 public:
1732 
1733 
1734 protected:
1735  hash<auto> getPlaceholdersAndValues(hash<auto> row);
1736 public:
1737 
1738 
1740 
1743  bool hasReturning();
1744 
1745 
1747 
1766  int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh, reference<string> sql, hash<auto> opt);
1767 
1768 
1770  int insertFromSelectCommit(list cols, AbstractTable source);
1771 
1772 
1774  int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh);
1775 
1776 
1778  int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh, reference<string> sql);
1779 
1780 
1782  int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh, hash<auto> opt);
1783 
1784 
1786 
1805  int insertFromSelect(list cols, AbstractTable source, hash<auto> sh, reference<string> sql, hash<auto> opt);
1806 
1807 
1809  int insertFromSelect(list cols, AbstractTable source);
1810 
1811 
1813  int insertFromSelect(list cols, AbstractTable source, hash<auto> sh);
1814 
1815 
1817  int insertFromSelect(list cols, AbstractTable source, hash<auto> sh, reference<string> sql);
1818 
1819 
1821  int insertFromSelect(list cols, AbstractTable source, hash<auto> sh, hash<auto> opt);
1822 
1823 
1825  deprecated int insertFromSelectNoCommit(list cols, AbstractTable source, *hash<auto> sh, *reference<string> sql, *hash<auto> opt);
1826 
1827 protected:
1828  int insertFromSelectIntern(list cols, AbstractTable source, *hash<auto> sh, *reference<string> sql, *hash<auto> opt);
1829 public:
1830 
1831 
1833 
1851  int insertFromIteratorCommit(Qore::AbstractIterator i, *hash<auto> opt);
1852 
1853 
1855 
1873  int insertFromIterator(Qore::AbstractIterator i, *hash<auto> opt);
1874 
1875 
1877  deprecated int insertFromIteratorNoCommit(Qore::AbstractIterator i, *hash<auto> opt);
1878 
1879 protected:
1880  int insertFromIteratorIntern(Qore::AbstractIterator i, *hash<auto> opt);
1881 public:
1882 
1883 
1885 
1901  int upsertCommit(hash<auto> row, int upsert_strategy = UpsertAuto, *hash<auto> opt);
1902 
1903 
1905 
1921  int upsert(hash<auto> row, int upsert_strategy = UpsertAuto, *hash<auto> opt);
1922 
1923 
1925  deprecated int upsertNoCommit(hash<auto> row, int upsert_strategy = UpsertAuto);
1926 
1928 
1949  code getUpsertClosure(hash<auto> row, int upsert_strategy = UpsertAuto, *hash<auto> opt);
1950 
1951 
1953 
1980  code getBulkUpsertClosure(hash example_row, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
1981 
1982 
1984 
2005  code getUpsertClosureWithValidation(hash example_row, int upsert_strategy = UpsertAuto, *hash<auto> opt);
2006 
2007 
2009 
2041  *hash upsertFromIteratorCommit(Qore::AbstractIterator i, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2042 
2043 
2045 
2077  *hash upsertFromIterator(Qore::AbstractIterator i, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2078 
2079 
2081  deprecated *hash upsertFromIteratorNoCommit(Qore::AbstractIterator i, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2082 
2083 protected:
2084  *hash upsertFromIteratorIntern(Qore::AbstractIterator i, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2085 public:
2086 
2087 
2088 protected:
2089  *hash<auto> doDeleteOthersIntern(hash pkh, *hash<auto> opt);
2090 public:
2091 
2092 
2094 
2132  *hash upsertFromSelectCommit(AbstractTable t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2133 
2134 
2136  *hash upsertFromSelectCommit(Table t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2137 
2138 
2140 
2180  *hash upsertFromSelect(AbstractTable t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2181 
2182 
2184  deprecated *hash upsertFromSelectNoCommit(AbstractTable t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2185 
2187  deprecated *hash upsertFromSelect(Table t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2188 
2190  deprecated *hash upsertFromSelectNoCommit(Table t, *hash<auto> sh, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2191 
2193 
2204  softint rowCount();
2205 
2206 
2208 
2229  Qore::SQL::SQLStatement getRowIterator(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2230 
2231 
2233 
2256  Qore::SQL::SQLStatement getRowIteratorNoExec(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2257 
2258 
2260 
2280  Qore::SQL::SQLStatement getRowIterator(*hash<auto> sh, *hash<auto> opt);
2281 
2282 
2284 
2306  Qore::SQL::AbstractSQLStatement getStatement(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2307 
2308 
2310 
2331  Qore::SQL::AbstractSQLStatement getStatement(*hash<auto> sh, *hash<auto> opt);
2332 
2333 
2335 
2357  Qore::SQL::AbstractSQLStatement getStatementNoExec(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2358 
2359 
2361 
2382  Qore::SQL::AbstractSQLStatement getStatementNoExec(*hash<auto> sh, *hash<auto> opt);
2383 
2384 
2385 protected:
2386  Qore::SQL::AbstractSQLStatement getStatementIntern(*hash<auto> sh, *reference<string> sql, *hash<auto> opt, *bool no_exec);
2387 public:
2388 
2389 
2391 
2410  *hash<auto> selectRow(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2411 
2412 
2414 
2432  *list selectRows(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2433 
2434 
2436 
2454  *hash<auto> select(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2455 
2456 
2458 
2476  *hash<auto> selectRow(*hash<auto> sh, *hash<auto> opt);
2477 
2478 
2480 
2497  *list selectRows(*hash<auto> sh, *hash<auto> opt);
2498 
2499 
2501 
2518  *hash<auto> select(*hash<auto> sh, *hash<auto> opt);
2519 
2520 
2522 
2540  string getSelectSql(*hash<auto> sh, *reference<list<auto>> args);
2541 
2542 
2543  *AbstractUniqueConstraint matchAnyUnique(list cols);
2544 
2545 
2546  string getSelectSqlIntern(*hash<auto> qh, reference<list<auto>> args, *hash<auto> opt);
2547 
2548 
2549  string getSelectSqlUnlocked(*hash<auto> qh, reference<list<auto>> args, *hash<auto> opt);
2550 
2551 
2552  // column & table information must be retrieved before calling this function
2553  string getSelectSqlUnlockedIntern(*hash<auto> qh, string from, reference<list<auto>> args, *hash<auto> ch, *hash<auto> opt);
2554 
2555 
2557  AbstractTable getSubtableFromString(string table, *hash<auto> opt);
2558 
2559 
2560 protected:
2561  string getFromIntern(string from, *hash<auto> qh);
2562 public:
2563 
2564 
2565 protected:
2566  list<auto> getGroupByListUnlocked(hash<auto> qh, *hash<auto> jch, *hash<auto> ch, *hash<auto> psch, list coll);
2567 public:
2568 
2569 
2570 protected:
2571  list<auto> getOrderByListUnlocked(hash<auto> qh, *hash<auto> jch, *hash<auto> ch, *hash<auto> psch, list coll);
2572 public:
2573 
2574 
2575 protected:
2576  list<auto> getGroupOrderByListUnlocked(string key, hash<auto> qh, *hash<auto> jch, *hash<auto> ch, *hash<auto> psch, list coll);
2577 public:
2578 
2579 
2580 protected:
2581  doForUpdate(reference<string> sql);
2582 public:
2583 
2584 
2585 protected:
2586  string getSelectSqlName(*hash<auto> qh);
2587 public:
2588 
2589 
2590 protected:
2591  string getColumnExpressionIntern(auto cvc, *hash<auto> jch, bool join, *hash<auto> ch, *hash<auto> psch);
2592 public:
2593 
2594 
2595 protected:
2596  string doColumnOperatorIntern(hash cvc, *hash<auto> jch, bool join, *hash<auto> ch, *hash<auto> psch, *reference psch_ref);
2597 public:
2598 
2599 
2600 protected:
2601  string doColumnOperatorIntern(auto cop, auto arg, *string cve, hash cm, *hash<auto> jch, bool join, *hash<auto> ch, *hash<auto> psch, *reference psch_ref);
2602 public:
2603 
2604 
2605 protected:
2606  string getColumnNameIntern(string cv, *hash<auto> jch, bool join, *hash<auto> ch, *hash<auto> psch);
2607 public:
2608 
2609 
2611 protected:
2612  bool asteriskRequiresPrefix();
2613 public:
2614 
2615 
2616 protected:
2617  getSelectWhereSqlUnlocked(reference<string> sql, reference<list<auto>> args, *hash<auto> qh, *hash<auto> jch, bool join = False, *hash<auto> ch, *hash<auto> psch);
2618 public:
2619 
2620 
2621 protected:
2622  *string getWhereClause(*hash cond, reference<list<auto>> args, *string cprefix, *hash<auto> jch, bool join = False);
2623 public:
2624 
2625 
2626 protected:
2627  *string getWhereClause(list cond, reference<list<auto>> args, *string cprefix, *hash<auto> jch, bool join = False);
2628 public:
2629 
2630 
2631 protected:
2632  *string getWhereClauseUnlocked(list cond, reference<list<auto>> args, *string cprefix, *hash<auto> jch, bool join = False, *hash pch, *hash<auto> psch);
2633 public:
2634 
2635 
2636 protected:
2637  *string getWhereClauseUnlocked(*hash cond, reference<list<auto>> args, *string cprefix, *hash<auto> jch, bool join = False, *hash pch, *hash<auto> psch);
2638 public:
2639 
2640 
2641 protected:
2642  *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);
2643 public:
2644 
2645 
2646 protected:
2647  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);
2648 public:
2649 
2650 
2651  string getOrClause(list<auto> arglist, reference<list<auto>> args, *hash<auto> jch, bool join = False, *hash<auto> ch, *hash<auto> psch);
2652 
2653 
2654  string getOrClause(hash<auto> arg, reference<list<auto>> args, *hash<auto> jch, bool join = False, *hash<auto> ch, *hash<auto> psch);
2655 
2656 
2657 protected:
2658  doSelectOrderBySqlUnlocked(reference<string> sql, reference<list<auto>> args, *hash<auto> qh, *hash<auto> jch, *hash<auto> ch, *hash<auto> psch, list coll);
2659 public:
2660 
2661 
2663 
2678  int delCommit(hash cond, reference<string> sql, hash<auto> opt);
2679 
2680 
2682  int delCommit(hash cond, hash<auto> opt);
2683 
2684 
2686  int delCommit(hash cond, reference<string> sql);
2687 
2688 
2690  int delCommit(hash cond);
2691 
2692 
2694  int delCommit();
2695 
2696 
2698 
2713  int del(hash cond, reference<string> sql, hash<auto> opt);
2714 
2715 
2717  int del(hash cond, hash<auto> opt);
2718 
2719 
2721  int del(hash cond, reference<string> sql);
2722 
2723 
2725  int del(hash cond);
2726 
2727 
2729  int del();
2730 
2731 
2733  deprecated int delNoCommit(*hash cond, *reference<string> sql);
2734 
2735 protected:
2736  int delIntern(*hash cond, *reference<string> sql, *hash<auto> opt);
2737 public:
2738 
2739 
2741 
2758  int updateCommit(hash set, hash cond, reference<string> sql, hash<auto> opt);
2759 
2760 
2762  int updateCommit(hash set, hash cond, reference<string> sql);
2763 
2764 
2766  int updateCommit(hash set, hash cond, hash<auto> opt);
2767 
2768 
2770  int updateCommit(hash set, hash cond);
2771 
2772 
2774  int updateCommit(hash set);
2775 
2776 
2778 
2795  int update(hash set, hash cond, reference<string> sql, hash<auto> opt);
2796 
2797 
2799  int update(hash set, hash cond, reference<string> sql);
2800 
2801 
2803  int update(hash set, hash cond, hash<auto> opt);
2804 
2805 
2807  int update(hash set, hash cond);
2808 
2809 
2811  int update(hash set);
2812 
2813 
2815 
2827  hash<SqlCommandInfo> getUpdateSql(hash<auto> set, *hash<auto> cond);
2828 
2829 
2831  deprecated int updateNoCommit(hash set, *hash cond, *reference<string> sql);
2832 
2834  deprecated int updateNoCommit(hash set, *hash cond, *hash<auto> opt);
2835 
2836 protected:
2837  int updateIntern(hash<auto> set, *hash<auto> cond, *reference<string> sql, *hash<auto> opt);
2838 public:
2839 
2840 
2841 protected:
2842  string getUpdateExpression(string col, hash<UpdateOperatorInfo> uh);
2843 public:
2844 
2845 
2846 protected:
2847  bool emptyDataIntern();
2848 public:
2849 
2850 
2851 protected:
2852  Columns checkUpsertRow(hash<auto> row, reference<int> upsert_strategy);
2853 public:
2854 
2855 
2856 protected:
2857  code getUpsertInsertFirst(Columns cols, hash example_row, *hash<auto> opt);
2858 public:
2859 
2860 
2861 protected:
2862  code getUpsertUpdateFirst(Columns cols, hash example_row, *hash<auto> opt);
2863 public:
2864 
2865 
2866 protected:
2867  code getUpsertSelectFirst(Columns cols, hash example_row, *hash<auto> opt);
2868 public:
2869 
2870 
2871 protected:
2872  code getUpsertInsertOnly(Columns cols, hash example_row, *hash<auto> opt);
2873 public:
2874 
2875 
2876 protected:
2877  code getUpsertUpdateOnly(Columns cols, hash example_row, *hash<auto> opt);
2878 public:
2879 
2880 
2881 protected:
2882  Columns getUpsertColumns(reference csrc);
2883 public:
2884 
2885 
2886 protected:
2887  string getUpsertSelectSql(hash<auto> row, Columns cols, reference<list<string>> updc);
2888 public:
2889 
2890 
2891 protected:
2892  string getUpsertInsertSql(hash<auto> row);
2893 public:
2894 
2895 
2896 protected:
2897  string getUpsertUpdateSql(hash<auto> row, Columns cols, reference updc, *hash<auto> opt);
2898 public:
2899 
2900 
2901 protected:
2902  softbool tryUpdate(string sql, hash<auto> row, Columns cols, list updc);
2903 public:
2904 
2905 
2906 protected:
2907  checkValue(string cname, string argname, reference val, string type);
2908 public:
2909 
2910 
2912 
2921  string getSqlFromList(list<auto> l);
2922 
2923 
2925 
2936  string getSqlValue(auto v);
2937 
2938 
2940  string getName();
2941 
2942 
2944 
2951  cache(*hash<auto> opts);
2952 
2953 
2955 
2960  clear();
2961 
2962 
2964 
2971  Columns describe();
2972 
2973 
2975 
2984 
2985 
2987 
2997 
2998 
2999  *AbstractUniqueConstraint findUniqueConstraintUnlocked(string name);
3000 
3001 
3003 
3012  Indexes getIndexes();
3013 
3014 
3016  ForeignConstraints getForeignConstraints(*hash<auto> opt);
3017 
3018 
3021 
3022 
3024 
3034 
3035 
3037 
3059  string getRenameSql(string new_name, *hash<auto> opt);
3060 
3061 
3063 
3072  string getCreateSqlString(*hash<auto> opt);
3073 
3074 
3076 
3085  list<auto> getCreateSql(*hash<auto> opt);
3086 
3087 
3089 
3100  string getCreateTableSql(*hash<auto> opt);
3101 
3102 
3104 
3108  bool checkExistence();
3109 
3110 
3111 protected:
3112  *hash<string, bool> getCheckOmissionOptions(*softlist<softstring> ol, string err);
3113 public:
3114 
3115 
3117 
3132  list<auto> getAlignSql(AbstractTable t, *hash<auto> opt);
3133 
3134 
3135 protected:
3136  list<auto> getAlignSqlUnlocked(AbstractTable t, *hash<auto> opt);
3137 public:
3138 
3139 
3140 protected:
3141  *AbstractColumnSupportingConstraint getSupportingConstraint(string ixname);
3142 public:
3143 
3144 
3145 protected:
3146  renameIndexUnlocked(AbstractIndex ix, string new_name);
3147 public:
3148 
3149 
3151 
3164  string getAlignSqlString(AbstractTable t, *hash<auto> opt);
3165 
3166 
3168 
3180  *list<auto> getCreateIndexesSql(*hash<auto> opt, bool cache = True);
3181 
3182 
3184 
3196  *string getCreatePrimaryKeySql(*hash<auto> opt, bool cache = True);
3197 
3198 
3200 
3212  *list<auto> getCreateForeignConstraintsSql(*hash<auto> opt, bool cache = True);
3213 
3214 
3216 
3230  *list<auto> getCreateConstraintsSql(*hash<auto> opt, bool cache = True);
3231 
3232 
3234 
3246  *list<auto> getCreateMiscSql(*hash<auto> opt, bool cache = True);
3247 
3248 
3250 
3264  *list<auto> getCreateTriggersSql(*hash<auto> opt, bool cache = True);
3265 
3266 
3268 
3275  *hash find(auto id);
3276 
3277 
3279 
3290  *list find(list ids);
3291 
3292 
3293 protected:
3294  string getPrimaryKeyColumn();
3295 public:
3296 
3297 
3299 
3312  *hash<auto> find(hash<auto> row);
3313 
3314 
3316 
3329  *hash<auto> findSingle(*hash<auto> cond);
3330 
3331 
3333 
3346  *list<auto> findAll(*hash<auto> cond);
3347 
3348 
3350 
3354  string getDesc();
3355 
3356 
3358  string getBaseType();
3359 
3360 
3362  string getSqlName();
3363 
3364 
3366  string getColumnSqlName(string col);
3367 
3368 
3370  list<auto> getColumnSqlNames(softlist cols);
3371 
3372 
3374 
3376  bool bindEmptyStringsAsNull();
3377 
3378 
3380 
3384  *hash<string, AbstractDataField> getRecordType();
3385 
3386 
3388 
3397  AbstractDataField getColumnDataField(string column_name, *hash<auto> options, *string append_desc);
3398 
3399 
3401 
3409  AbstractDataField getColumnDataField(AbstractColumn column, *hash<SqlUtilDataTypeOptionInfo> options, *string append_desc);
3410 
3411 
3413 
3421  AbstractDataProviderType getColumnDataType(string column_name, *hash<SqlUtilDataTypeOptionInfo> options);
3422 
3423 
3425 
3427  AbstractDataProviderType getDbType(string native_type, *string qore_type, bool nullable, int max_size = -1, *hash<SqlUtilDataTypeOptionInfo> options);
3428 
3429 
3431 
3433  AbstractDataProviderType getNumericType(string type_name, bool nullable, *hash<auto> options);
3434 
3435 
3437 
3441  AbstractSavepointHelper getSavepointHelper(*string savepoint);
3442 
3443 
3445  abstract bool hasArrayBind();
3446 
3448 
3450 protected:
3451  hash<auto> getTableOptions();
3452 public:
3453 
3454 
3456 
3458 protected:
3459  hash<auto> getForeignConstraintOptions();
3460 public:
3461 
3462 
3464 
3466 protected:
3467  hash<auto> getConstraintOptions();
3468 public:
3469 
3470 
3472 
3474 protected:
3475  hash<auto> getCacheOptions();
3476 public:
3477 
3478 
3480 
3482 protected:
3483  hash<auto> getTableCreationOptions();
3484 public:
3485 
3486 
3488 
3490 protected:
3491  hash<auto> getAlignTableOptions();
3492 public:
3493 
3494 
3496 
3498 protected:
3499  hash<auto> getTableDescriptionHashOptions();
3500 public:
3501 
3502 
3504 
3506 protected:
3507  hash<auto> getColumnOptions();
3508 public:
3509 
3510 
3512 
3514 protected:
3515  hash<auto> getColumnDescOptions();
3516 public:
3517 
3518 
3520 
3522 protected:
3523  hash<auto> getTableColumnDescOptions();
3524 public:
3525 
3526 
3528 
3530 protected:
3531  hash<auto> getIndexOptions();
3532 public:
3533 
3534 
3536 
3538 protected:
3539  hash<auto> getTriggerOptions();
3540 public:
3541 
3542 
3544 
3546 protected:
3547  hash<auto> getSelectOptions();
3548 public:
3549 
3550 
3552 
3554 protected:
3555  hash<auto> getUpsertOptions();
3556 public:
3557 
3558 
3560 
3562 protected:
3563  hash<auto> getInsertOptions();
3564 public:
3565 
3566 
3568 
3570 protected:
3571  hash<auto> getInsertFromIteratorOptions();
3572 public:
3573 
3574 
3576 
3578 protected:
3579  hash<auto> getSqlDataCallbackOptions();
3580 public:
3581 
3582 
3584 
3586 protected:
3587  hash<auto> getWhereOperatorMap();
3588 public:
3589 
3590 
3592 
3594 protected:
3595  hash<auto> getColumnOperatorMap();
3596 public:
3597 
3598 
3600 protected:
3601  *hash<auto> getColumnOperatorMapImpl();
3602 public:
3603 
3604 
3606 
3642  addCustomCopOperator(string name, hash<auto> operator);
3643 
3644 
3646 
3648 protected:
3649  hash<auto> getInsertOperatorMap();
3650 public:
3651 
3652 
3654 
3656 protected:
3657  hash<auto> getUpdateOperatorMap();
3658 public:
3659 
3660 
3662 
3664 protected:
3665  hash<auto> getRawUpdateOperatorMap();
3666 public:
3667 
3668 
3670 
3672 protected:
3673  *hash<auto> getPseudoColumnHash();
3674 public:
3675 
3676 
3677 protected:
3678  string getCreateTableSqlUnlocked(*hash<auto> opt);
3679 public:
3680 
3681 
3682 protected:
3683  *list<auto> getCreateIndexesSqlUnlocked(*hash<auto> opt, bool cache = True);
3684 public:
3685 
3686 
3687 protected:
3688  *string getCreatePrimaryKeySqlUnlocked(*hash<auto> opt, bool cache = True);
3689 public:
3690 
3691 
3692 protected:
3693  *list<auto> getCreateConstraintsSqlUnlocked(*hash<auto> opt, bool cache = True);
3694 public:
3695 
3696 
3697 protected:
3698  *list<auto> getCreateForeignConstraintsSqlUnlocked(*hash<auto> opt, bool cache = True);
3699 public:
3700 
3701 
3702 protected:
3703  *list<auto> getCreateMiscSqlUnlocked(*hash<auto> opt, bool cache = True);
3704 public:
3705 
3706 
3707 protected:
3708  *list<auto> getCreateTriggersSqlUnlocked(*hash<auto> opt, bool cache = True);
3709 public:
3710 
3711 
3712 protected:
3713  list<auto> getCreateSqlUnlocked(*hash<auto> opt, bool cache = True);
3714 public:
3715 
3716 
3717 protected:
3718  cacheUnlocked(*hash<auto> opt);
3719 public:
3720 
3721 
3722 protected:
3723  auto execData(*hash<auto> opt, string sql, *list<auto> args);
3724 public:
3725 
3726 
3727 protected:
3728  execData(AbstractSQLStatement stmt, *hash<auto> opt, *list<auto> args);
3729 public:
3730 
3731 
3732  static AbstractTable getTable(AbstractDatasource nds, string nname, *hash<auto> opts);
3733 
3734  static AbstractTable getTable(string dsstr, string nname, *hash<auto> opts);
3735 
3736  static AbstractTable getTable(hash<auto> dsh, string nname, *hash<auto> opts);
3737 
3738 protected:
3739  getColumnsUnlocked();
3740 public:
3741 
3742 
3743 protected:
3744  getPrimaryKeyUnlocked();
3745 public:
3746 
3747 
3748  // also loads primary key and constraints (for unique constraints)
3749 protected:
3750  getIndexesUnlocked();
3751 public:
3752 
3753 
3754 protected:
3755  getForeignConstraintsUnlocked(*hash<auto> opt);
3756 public:
3757 
3758 
3759 protected:
3760  addSourceConstraint(string table_name, AbstractForeignConstraint fk);
3761 public:
3762 
3763 
3764 protected:
3765  getConstraintsUnlocked();
3766 public:
3767 
3768 
3769 protected:
3770  getTriggersUnlocked();
3771 public:
3772 
3773 
3775 protected:
3776  bool hasReturningImpl();
3777 public:
3778 
3779 
3780 protected:
3781  softlist<auto> getDropSqlImpl();
3782 public:
3783 
3784 
3785 protected:
3786  string getTruncateSqlImpl();
3787 public:
3788 
3789 
3791 protected:
3792  auto tryExecArgsImpl(string sql, *softlist<auto> args);
3793 public:
3794 
3795 
3797 protected:
3798  auto tryExecRawImpl(string sql);
3799 public:
3800 
3801 
3803 protected:
3804  clearImpl();
3805 public:
3806 
3807 
3808 protected:
3809  preSetupTableImpl(reference desc, *hash<auto> opt);
3810 public:
3811 
3812 
3814 
3816 protected:
3817  abstract AbstractDataProviderType getNumericTypeImpl(string type_name, bool nullable, *hash<auto> options);
3818 public:
3819 
3820 protected:
3821  abstract *hash<auto> doReturningImpl(hash<auto> opt, reference<string> sql, list<auto> args);
3822 public:
3823 
3824 protected:
3825  abstract bool emptyImpl();
3826 public:
3827 
3829 protected:
3830  abstract *string getSqlValueImpl(auto v);
3831 public:
3832 
3834 
3837 protected:
3838  abstract bool checkExistenceImpl();
3839 public:
3840 
3842 protected:
3843  abstract bool supportsTablespacesImpl();
3844 public:
3845 
3847 protected:
3848  abstract bool constraintsLinkedToIndexesImpl();
3849 public:
3850 
3852 protected:
3853  abstract bool uniqueIndexCreatesConstraintImpl();
3854 public:
3855 
3856 protected:
3857  abstract setupTableImpl(hash<auto> desc, *hash<auto> opt);
3858 public:
3859 
3860 protected:
3861  abstract Columns describeImpl();
3862 public:
3863 protected:
3864  abstract AbstractPrimaryKey getPrimaryKeyImpl();
3865 public:
3866 protected:
3867  abstract Indexes getIndexesImpl();
3868 public:
3869 protected:
3870  abstract ForeignConstraints getForeignConstraintsImpl(*hash<auto> opt);
3871 public:
3872 protected:
3873  abstract Constraints getConstraintsImpl();
3874 public:
3875 protected:
3876  abstract Triggers getTriggersImpl();
3877 public:
3878 
3879 protected:
3880  abstract string getCreateTableSqlImpl(*hash<auto> opt);
3881 public:
3882 protected:
3883  abstract *list<auto> getCreateMiscSqlImpl(*hash<auto> opt, bool cache);
3884 public:
3885 protected:
3886  abstract string getCreateSqlImpl(list<auto> l);
3887 public:
3888 protected:
3889  abstract string getRenameSqlImpl(string new_name);
3890 public:
3891 protected:
3892  abstract *list<auto> getAlignSqlImpl(AbstractTable t, *hash<auto> opt);
3893 public:
3894 
3895 protected:
3896  abstract AbstractColumn addColumnImpl(string cname, hash<auto> opt, bool nullable = True);
3897 public:
3898 protected:
3899  abstract AbstractPrimaryKey addPrimaryKeyImpl(string cname, hash<auto> ch, *hash<auto> opt);
3900 public:
3901 protected:
3902  abstract AbstractIndex addIndexImpl(string iname, bool enabled, hash<auto> ch, *hash<auto> opt);
3903 public:
3904 protected:
3905  abstract AbstractForeignConstraint addForeignConstraintImpl(string cname, hash<auto> ch, string table, hash<auto> tch, *hash<auto> opt);
3906 public:
3907 protected:
3908  abstract AbstractCheckConstraint addCheckConstraintImpl(string cname, string src, *hash<auto> opt);
3909 public:
3910 protected:
3911  abstract AbstractUniqueConstraint addUniqueConstraintImpl(string cname, hash<auto> ch, *hash<auto> opt);
3912 public:
3913 
3914 protected:
3915  abstract AbstractTrigger addTriggerImpl(string tname, string src, *hash<auto> opt);
3916 public:
3917 
3919 protected:
3920  abstract bool tryInsertImpl(string sql, hash<auto> row);
3921 public:
3922 
3924 protected:
3925  abstract hash<auto> getQoreTypeMapImpl();
3926 public:
3927 
3929 protected:
3930  abstract hash<auto> getTypeMapImpl();
3931 public:
3932 
3934 protected:
3935  abstract doSelectOrderByWithOffsetSqlUnlockedImpl(reference<string> sql, reference<list<auto>> args, *hash<auto> qh, *hash<auto> jch, *hash<auto> ch, *hash<auto> psch, list coll);
3936 public:
3937 
3939 protected:
3940  abstract doSelectLimitOnlyUnlockedImpl(reference<string> sql, reference<list<auto>> args, *hash<auto> qh);
3941 public:
3942 
3944 protected:
3945  abstract copyImpl(AbstractTable old);
3946 public:
3947 
3949 
3953 protected:
3954  abstract AbstractSavepointHelper getSavepointHelperImpl(*string savepoint);
3955 public:
3956 };
3957 };
SqlUtil::AbstractTable::TableOptions
const TableOptions
table options
Definition: AbstractTable.qc.dox.h:44
SqlUtil::AbstractTable::renameIndex
AbstractIndex renameIndex(string old_name, string new_name, reference< string > sql)
renames an existing index; if the table is already known to be in the database, then the changes are ...
SqlUtil::AbstractTable::getSqlName
string getSqlName()
returns the name of the table to be used in SQL (with a possible qualifier for schema,...
SqlUtil::AbstractTable::upsertFromIteratorNoCommit
deprecated *hash upsertFromIteratorNoCommit(Qore::AbstractIterator i, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
A legacy SqlUtik::AbstractTable::upsertFromIterator() wrapper.
SqlUtil::AbstractTable::constraints
Constraints constraints
constraint descriptions
Definition: AbstractTable.qc.dox.h:391
SqlUtil::AbstractTable::tryExecArgs
auto tryExecArgs(string sql, *softlist< auto > args)
executes some SQL with optional arguments so that if an error occurs the current transaction state is...
SqlUtil::AbstractTable::getCreateTableSql
string getCreateTableSql(*hash< auto > opt)
returns an SQL string that could be used to create the basic table structure without indexes and cons...
SqlUtil::AbstractTable::getNumericType
AbstractDataProviderType getNumericType(string type_name, bool nullable, *hash< auto > options)
returns the type for number / numeric columns for the database so that data conversions can be handle...
SqlUtil::AbstractTable::getSqlDataCallbackOptions
hash< auto > getSqlDataCallbackOptions()
returns the sql data operation callback options for this driver
SqlUtil::AbstractTable::create
create(*hash< auto > opt)
creates the table with all associated properties (indexes, constraints, etc) without any transaction ...
SqlUtil::AbstractTable::addUniqueConstraint
AbstractUniqueConstraint addUniqueConstraint(string cname, softlist cols, *hash< auto > opt, *reference< string > sql)
adds a unique constraint to the table; if the table is known to be in the database already,...
SqlUtil::AbstractTable::manual
bool manual
manual edits
Definition: AbstractTable.qc.dox.h:399
SqlUtil::AbstractTable::getPrimaryKey
AbstractPrimaryKey getPrimaryKey()
returns an object of class AbstractPrimaryKey describing the primary key of the table
SqlUtil::AbstractTable::inDb
bool inDb
in database
Definition: AbstractTable.qc.dox.h:397
SqlUtil::AbstractTable::findAll
*list< auto > findAll(*hash< auto > cond)
finds all rows in the table with the given column values; a list of hashes is returned representing t...
SqlUtil::AbstractTable::asteriskRequiresPrefix
bool asteriskRequiresPrefix()
returns True if the database requires a wildcard "*" to be prefixed with the table name when it appea...
SqlUtil::AbstractTable::clearImpl
clearImpl()
clears any driver-specific table information
SqlUtil::AbstractTable::UpsertSelectFirst
const UpsertSelectFirst
Upsert option: select first, if the row is unchanged, do nothing, if it doesn't exist,...
Definition: AbstractTable.qc.dox.h:280
SqlUtil::AbstractTable::getInsertOperatorMap
hash< auto > getInsertOperatorMap()
returns the insert operator map for this object
SqlUtil::AbstractTable::getUpdateSql
hash< SqlCommandInfo > getUpdateSql(hash< auto > set, *hash< auto > cond)
Returns the SQL for the given update parameters.
SqlUtil::AbstractTable::getUpsertClosure
code getUpsertClosure(hash< auto > row, int upsert_strategy=UpsertAuto, *hash< auto > opt)
returns a closure that can be executed given a hash argument representing a single row that will be u...
SqlUtil::AbstractTable::getCreateTriggersSql
*list< auto > getCreateTriggersSql(*hash< auto > opt, bool cache=True)
returns a list of SQL strings that could be used to create triggers on the table or NOTHING if there ...
SqlUtil::AbstractTrigger
the base class for triggers
Definition: SqlUtil.qm.dox.h:6385
SqlUtil::AbstractUniqueConstraint
represents a unique column constraint
Definition: SqlUtil.qm.dox.h:6101
SqlUtil::ForeignConstraints
foreign constraint container class that throws an exception if an unknown constraint is accessed
Definition: SqlUtil.qm.dox.h:6121
SqlUtil::AbstractTable::UR_Verified
const UR_Verified
row was updated unconditionally (not returned with UpsertSelectFirst)
Definition: AbstractTable.qc.dox.h:336
SqlUtil::AbstractTable::setDatasource
setDatasource(AbstractDatasource nds)
changes the datasource for the table; if the inDb flag is True, then it is set to False by calling th...
SqlUtil::AbstractTable::dropPrimaryKey
AbstractPrimaryKey dropPrimaryKey(*reference lsql)
drops the primary key from the table; if the table is known to be in the database already,...
SqlUtil::AbstractTable::primaryKey
AbstractPrimaryKey primaryKey
primary key description
Definition: AbstractTable.qc.dox.h:385
type
string type(auto arg)
SqlUtil::AbstractTable::getAddIndexSql
string getAddIndexSql(string iname, bool unique, softlist cols, *hash< auto > ixopt, *hash< auto > opt)
returns an SQL string that can be used to add an index to the table
SqlUtil::AbstractTable::triggers
Triggers triggers
trigger descriptions
Definition: AbstractTable.qc.dox.h:393
SqlUtil::AbstractTable::constraintsLinkedToIndexesImpl
abstract bool constraintsLinkedToIndexesImpl()
returns True if the database links constraints to indexes (ie dropping the constraint drops the index...
SqlUtil::AbstractTable::truncate
truncate()
truncates all the table data without any transaction management
SqlUtil::AbstractTable::InsertOptions
const InsertOptions
generic SQL insert options
Definition: AbstractTable.qc.dox.h:214
SqlUtil::AbstractTable::uniqueIndexCreatesConstraintImpl
abstract bool uniqueIndexCreatesConstraintImpl()
returns True if the database automatically creates a unique constraint when a unique index is created...
SqlUtil::AbstractTable::updateNoCommit
deprecated int updateNoCommit(hash set, *hash cond, *reference< string > sql)
A legacy SqlUtil::AbstractTable::update() wrapper.
SqlUtil::AbstractTable::dropIndex
AbstractIndex dropIndex(string iname, *reference< string > sql)
drops the given index from the table; if the table is known to be in the database already,...
SqlUtil::AbstractTable::del
int del()
SqlUtil::AbstractTable::del() variant
SqlUtil::AbstractTable::TriggerOptions
const TriggerOptions
default trigger options
Definition: AbstractTable.qc.dox.h:80
SqlUtil::AbstractTable::getSubtableFromString
AbstractTable getSubtableFromString(string table, *hash< auto > opt)
Returns the given table from the argument, using any "tablecode" option if present.
SqlUtil::AbstractTable::rollback
rollback()
rolls back the current transaction on the underlying Qore::SQL::AbstractDatasource
SqlUtil::AbstractTable::UpsertResultMap
const UpsertResultMap
hash mapping upsert results to a description
Definition: AbstractTable.qc.dox.h:351
SqlUtil::AbstractTable::getDropConstraintSql
string getDropConstraintSql(string cname, *hash< auto > opt)
gets the SQL that can be used to drop a constraint from the table; this can be any constraint on the ...
SqlUtil::AbstractTable::insertNoCommit
deprecated *hash< auto > insertNoCommit(hash< auto > row, *reference< string > sql, *hash< auto > opt)
A legacy wrapper for SqlUtil::AbstractTable::insert()
SqlUtil::AbstractTable::copyImpl
abstract copyImpl(AbstractTable old)
db-specific copy actions
SqlUtil::AbstractTable::addPrimaryKey
AbstractPrimaryKey addPrimaryKey(string pkname, softlist cols, *hash< auto > opt, *reference< string > sql)
adds a primary key to the table; if the table is already known to be in the database,...
Qore::SQL::SQLStatement
SqlUtil::AbstractTable::find
*hash find(auto id)
finds a row in the table with the given primary key value; if no row matches the primary key value pa...
SqlUtil::AbstractTable::tryExecRaw
auto tryExecRaw(string sql)
executes some SQL so that if an error occurs the current transaction state is not lost
SqlUtil::AbstractTable::ColumnDescOptions
const ColumnDescOptions
Column description options.
Definition: AbstractTable.qc.dox.h:171
SqlUtil::AbstractTable::update
int update(hash set, hash cond, reference< string > sql, hash< auto > opt)
updates rows in the table matching an optional condition and returns the count of rows updated; no tr...
SqlUtil::AbstractTable::columns
Columns columns
column description object
Definition: AbstractTable.qc.dox.h:383
SqlUtil::AbstractTable::getCreateConstraintsSql
*list< auto > getCreateConstraintsSql(*hash< auto > opt, bool cache=True)
returns a list of SQL strings that could be used to create non-foreign constraints on the table or NO...
SqlUtil::AbstractTable::select
*hash< auto > select(*hash< auto > sh, *reference< string > sql, *hash< auto > opt)
returns a hash of lists representing the columns and rows in the table that match the argument hahs
SqlUtil::AbstractTable::addIndex
AbstractIndex addIndex(string iname, bool unique, softlist cols, *hash< auto > opt, *reference< string > sql)
adds an index to the table; if the table is already known to be in the database, then it is added in ...
SqlUtil::AbstractTable::insertFromIteratorNoCommit
deprecated int insertFromIteratorNoCommit(Qore::AbstractIterator i, *hash< auto > opt)
A legacy SqlUtil::AbstractTable::insertFromIterator() wrapper.
SqlUtil::AbstractTable::getRowIterator
Qore::SQL::SQLStatement getRowIterator(*hash< auto > sh, *reference< string > sql, *hash< auto > opt)
returns an SQLStatement object that will iterate the results of a select statement matching the argum...
SqlUtil::AbstractTable::findUniqueConstraint
*AbstractUniqueConstraint findUniqueConstraint(string name)
returns the given AbstractUniqueConstraint object if defined for the table (also includes the primary...
SqlUtil::AbstractTable::TableCreationOptions
const TableCreationOptions
table creation options
Definition: AbstractTable.qc.dox.h:113
SqlUtil::AbstractTable::insertFromSelectCommit
int insertFromSelectCommit(list cols, AbstractTable source, hash< auto > sh, reference< string > sql, hash< auto > opt)
inserts rows into a table based on a select statement from another table (which must be using the sam...
SqlUtil::AbstractTable::UpsertInsertFirst
const UpsertInsertFirst
Upsert option: insert first, if the insert fails, then update.
Definition: AbstractTable.qc.dox.h:263
SqlUtil::AbstractTable::SqlDataCallbackOptions
const SqlDataCallbackOptions
generic SQL data operation callbacks
Definition: AbstractTable.qc.dox.h:199
SqlUtil::AbstractTable::tryExecArgsImpl
auto tryExecArgsImpl(string sql, *softlist< auto > args)
tries to execute a command so that if an error occurs the current transaction status is not lost
SqlUtil::AbstractTable::checkExistenceImpl
abstract bool checkExistenceImpl()
returns True if the table exists in the DB, False if not
SqlUtil::AbstractSqlUtilBase
base class for abstract SqlUtil classes
Definition: AbstractSqlUtilBase.qc.dox.h:34
SqlUtil::AbstractTable::bindEmptyStringsAsNull
bool bindEmptyStringsAsNull()
returns True if the DB treats empty strings as NULL, False if not; by default this method returns Fal...
SqlUtil::AbstractTable::copy
copy(AbstractTable old)
copies the object
SqlUtil::AbstractTable::tryInsertImpl
abstract bool tryInsertImpl(string sql, hash< auto > row)
tries to insert a row, if there is a duplicate key, then it returns False, if successful,...
SqlUtil::AbstractTable::dropForeignConstraint
AbstractForeignConstraint dropForeignConstraint(string cname, *reference< string > sql)
drops a foreign constraint from the table; if the table is known to be in the database already,...
SqlUtil::AbstractTable::UR_Inserted
const UR_Inserted
row was inserted
Definition: AbstractTable.qc.dox.h:333
SqlUtil::AbstractTable::rowCount
softint rowCount()
returns the number of rows in the table
SqlUtil::AbstractTable::updateCommit
int updateCommit(hash set, hash cond, reference< string > sql, hash< auto > opt)
updates rows in the table matching an optional condition and returns the count of rows updated; the t...
SqlUtil::AbstractForeignConstraint
the base class for foreign key constraint information
Definition: SqlUtil.qm.dox.h:6187
SqlUtil::AbstractTable::insert
*hash< auto > insert(hash< auto > row)
inserts a row into the table without any transaction management; a transaction will be in progress af...
SqlUtil::AbstractTable::UR_Deleted
const UR_Deleted
row was deleted (only possible with batch upsert methods such as AbstractTable::upsertFromIterator() ...
Definition: AbstractTable.qc.dox.h:345
SqlUtil::AbstractTable::TableDescriptionHashOptions
const TableDescriptionHashOptions
Table description options.
Definition: AbstractTable.qc.dox.h:147
SqlUtil::AbstractTable::addColumn
AbstractColumn addColumn(string cname, hash< auto > opt, bool nullable=True, *reference lsql)
adds a column to the table; if the table is already known to be in the database, then it is added in ...
SqlUtil::AbstractTable::getStatement
Qore::SQL::AbstractSQLStatement getStatement(*hash< auto > sh, *reference< string > sql, *hash< auto > opt)
returns an AbstractSQLStatement object that will iterate the results of a select statement matching t...
SqlUtil::AbstractTable::ConstraintOptions
const ConstraintOptions
default constraint options
Definition: AbstractTable.qc.dox.h:62
SqlUtil::AbstractTable::IndexOptions
const IndexOptions
default index options
Definition: AbstractTable.qc.dox.h:54
SqlUtil::AbstractTable::setupTable
setupTable(hash< auto > desc, *hash< auto > opt)
creates the object from a table description hash
True
const True
SqlUtil::AbstractTable::getRecordType
*hash< string, AbstractDataField > getRecordType()
returns a record description for the table
SqlUtil::AbstractTable::createNoCommit
deprecated createNoCommit(*hash< auto > opt)
A legacy wrapper for create()
SqlUtil::Table
represents a database table; this class embeds an AbstractTable object that is created automatically ...
Definition: Table.qc.dox.h:50
SqlUtil::AbstractTable::getSqlFromList
string getSqlFromList(list< auto > l)
returns an SQL string corresponding to the list of commands in the argument
SqlUtil::AbstractTable::selectRow
*hash< auto > selectRow(*hash< auto > sh, *reference< string > sql, *hash< auto > opt)
returns a hash representing the row in the table that matches the argument hash; if more than one row...
SqlUtil::AbstractTable::removeForeignConstraint
AbstractForeignConstraint removeForeignConstraint(string cname)
removes the named foreign constraint from the table; no SQL is executed in any case,...
SqlUtil::AbstractTable::getDropTriggerSql
list< auto > getDropTriggerSql(string tname, *hash< auto > opt)
returns SQL that can be used to drop the given trigger from the table
SqlUtil::AbstractTable::getCacheOptions
hash< auto > getCacheOptions()
returns the cache options for this driver
SqlUtil::AbstractTable::UpsertStrategyMap
const UpsertStrategyMap
hash mapping upsert strategy codes to a text description
Definition: AbstractTable.qc.dox.h:306
SqlUtil::AbstractTable::getAddUniqueConstraintSql
string getAddUniqueConstraintSql(string cname, softlist cols, *hash ukopt, *hash< auto > opt)
returns an SQL string that can be used to add a unique constraint to the table
SqlUtil::AbstractTable::findSingle
*hash< auto > findSingle(*hash< auto > cond)
finds a single row in the table that match the row condition passed; multiple rows may match,...
SqlUtil::AbstractTable::getForeignConstraintOptions
hash< auto > getForeignConstraintOptions()
return the foreign constraint options for this driver
SqlUtil::AbstractTable::UpsertAuto
const UpsertAuto
Upsert option: if the target table is empty, use UpsertInsertFirst, otherwise use UpsertUpdateFirst.
Definition: AbstractTable.qc.dox.h:287
SqlUtil::AbstractTable::cache
cache(*hash< auto > opts)
reads in all attributes of the table from the database
SqlUtil::AbstractTable::getIndexOptions
hash< auto > getIndexOptions()
returns the index options for this driver
SqlUtil::AbstractTable::UR_Unchanged
const UR_Unchanged
row was unchanged (only possible with UpsertSelectFirst, UpsertInsertOnly, and UpsertUpdateOnly)
Definition: AbstractTable.qc.dox.h:342
SqlUtil::AbstractTable::doSelectLimitOnlyUnlockedImpl
abstract doSelectLimitOnlyUnlockedImpl(reference< string > sql, reference< list< auto >> args, *hash< auto > qh)
processes a string for use in SQL select statements when there is a "limit" argument,...
SqlUtil::AbstractTable::renameColumn
AbstractColumn renameColumn(string old_name, string new_name, reference< string > sql)
renames an existing column; if the table is already known to be in the database, then the changes are...
SqlUtil::AbstractTable::getIndexes
Indexes getIndexes()
returns an object of class Indexes describing the indexes on the table
SqlUtil::AbstractTable::getName
string getName()
returns the name of the table
SqlUtil::AbstractTable::getInsertFromIteratorOptions
hash< auto > getInsertFromIteratorOptions()
returns the insert from iterator options for this driver
SqlUtil::AbstractTable::hasReturning
bool hasReturning()
returns True if the current database driver supports the "returning" clause in insert statements,...
SqlUtil::AbstractTable::supportsTablespacesImpl
abstract bool supportsTablespacesImpl()
returns True if the database support tablespaces
SqlUtil::AbstractTable::AdditionalColumnDescOptions
const AdditionalColumnDescOptions
additional column description keys valid when describing columns in a table description hash
Definition: AbstractTable.qc.dox.h:187
SqlUtil::AbstractSqlUtilBase::opts
*hash< auto > opts
option hash
Definition: AbstractSqlUtilBase.qc.dox.h:41
SqlUtil::AbstractTable::upsertFromSelectNoCommit
deprecated *hash upsertFromSelectNoCommit(AbstractTable t, *hash< auto > sh, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
A legacy SqlUtil::AbstractTable::upsertFromSelect() wrapper.
SqlUtil::AbstractColumn
the base class for column information
Definition: SqlUtil.qm.dox.h:5642
SqlUtil::AbstractTable::getUpsertOptions
hash< auto > getUpsertOptions()
returns the upsert options for this driver
SqlUtil::AbstractTable::UpsertResultLetterMap
const UpsertResultLetterMap
maps upsert result codes to single letter symbols
Definition: AbstractTable.qc.dox.h:371
SqlUtil::AbstractIndex
the abstract base class for index information
Definition: SqlUtil.qm.dox.h:5817
SqlUtil::AbstractTable::upsertNoCommit
deprecated int upsertNoCommit(hash< auto > row, int upsert_strategy=UpsertAuto)
A legacy SqlUtil::AbstractTable::upsert() wrapper.
SqlUtil::AbstractTable::getTableDescriptionHashOptions
hash< auto > getTableDescriptionHashOptions()
returns the table description hash<auto> options for this driver
SqlUtil::AbstractTable::getDropColumnSql
list< auto > getDropColumnSql(string cname, *hash< auto > opt)
returns the SQL that can be used to drop a column from the table
SqlUtil::AbstractTable::upsertFromIteratorCommit
*hash upsertFromIteratorCommit(Qore::AbstractIterator i, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
this method upserts or merges data from the given iterator argument (whose getValue() method must ret...
SqlUtil::AbstractSavepointHelper
Abstract base class for savepoint helpers for epheremal transaction support.
Definition: AbstractSavepointHelper.qc.dox.h:33
SqlUtil::AbstractTable::TableOmissionOptions
const TableOmissionOptions
alignment omission options
Definition: AbstractTable.qc.dox.h:103
SqlUtil::AbstractTable::getTruncateSql
string getTruncateSql(*hash< auto > opt)
gets the SQL that can be used to truncate the table
SqlUtil::AbstractTable::UpsertStrategyDescriptionMap
const UpsertStrategyDescriptionMap
hash mapping upsert strategy descriptions to upsert strategy codes
Definition: AbstractTable.qc.dox.h:318
SqlUtil::AbstractTable::getDropConstraintIfExistsSql
*string getDropConstraintIfExistsSql(string cname, *hash< auto > opt, *reference< AbstractConstraint > cref)
gets the SQL that can be used to drop a constraint from the table if it exists, otherwise returns NOT...
SqlUtil::AbstractTable::delNoCommit
deprecated int delNoCommit(*hash cond, *reference< string > sql)
A legacy SqlUtil::AbstractTable::del() wrapper.
SqlUtil::AbstractTable::upsertCommit
int upsertCommit(hash< auto > row, int upsert_strategy=UpsertAuto, *hash< auto > opt)
update or insert the data in the table according to the hash argument; the table must have a unique k...
SqlUtil::AbstractTable::UR_Updated
const UR_Updated
row was updated because it was different (only possible with UpsertSelectFirst)
Definition: AbstractTable.qc.dox.h:339
SqlUtil::AbstractTable::getColumnDataField
AbstractDataField getColumnDataField(string column_name, *hash< auto > options, *string append_desc)
returns a field object for the given column
SqlUtil::AbstractTable::rename
rename(string new_name, *reference< string > sql, *Tables table_cache)
renames the table; if the table is already known to be in the database in the database,...
SqlUtil::AbstractTable::UpsertInsertOnly
const UpsertInsertOnly
Upsert option: insert if the row does not exist, otherwise ignore.
Definition: AbstractTable.qc.dox.h:294
SqlUtil::AbstractTable::getTableOptions
hash< auto > getTableOptions()
returns the table options for this driver
SqlUtil::AbstractTable::getDropPrimaryKeySql
list< auto > getDropPrimaryKeySql(*hash< auto > opt)
gets a list of SQL strings that can be used to drop the primary key from the table
SqlUtil::AbstractTable::getWhereOperatorMap
hash< auto > getWhereOperatorMap()
returns the "where" operator map for this object
SqlUtil::AbstractTable::getPseudoColumnHash
*hash< auto > getPseudoColumnHash()
returns a hash of valid pseudocolumns
SqlUtil::AbstractTable::checkExistence
bool checkExistence()
returns True if the table exists in the database, False if not
SqlUtil::AbstractTable::getColumnOptions
hash< auto > getColumnOptions()
returns the column options for this driver
SqlUtil::AbstractCheckConstraint
abstract class for check constraints
Definition: SqlUtil.qm.dox.h:5990
SqlUtil::AbstractTable::createCommit
createCommit(*hash< auto > opt)
creates the table in the database; releases the transaction lock after creating the table
SqlUtil::AbstractTable::ColumnOptions
const ColumnOptions
Column options; this is currently empty and can be extended in database-specific modules.
Definition: AbstractTable.qc.dox.h:192
list
list< auto > list(...)
SqlUtil::AbstractTable::commit
commit()
commits the current transaction on the underlying Qore::SQL::AbstractDatasource
SqlUtil::AbstractTable::getTableColumnDescOptions
hash< auto > getTableColumnDescOptions()
returns the table column description options for this driver
SqlUtil::AbstractTable::getSelectSql
string getSelectSql(*hash< auto > sh, *reference< list< auto >> args)
returns the SQL string to be executed corresponding to the argument hash with an output parameter for...
SqlUtil::AbstractTable::getTableCreationOptions
hash< auto > getTableCreationOptions()
returns the table creation options for this driver
SqlUtil::AbstractTable::SelectOptions
const SelectOptions
default possible select options; can be extended by driver-specific modules
Definition: AbstractTable.qc.dox.h:85
String
const String
SqlUtil::AbstractTable::dropNoCommit
deprecated dropNoCommit(*hash< auto > opt)
A legacy wrapper for drop()
SqlUtil::AbstractTable::upsertFromIterator
*hash upsertFromIterator(Qore::AbstractIterator i, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
this method upserts or merges data from the given iterator argument (whose getValue() method must ret...
SqlUtil::AbstractTable::getDropAllConstraintsAndIndexesOnColumnSql
list< auto > getDropAllConstraintsAndIndexesOnColumnSql(string cname, *hash< auto > opt)
gets a list of SQL strings to drop all constraints and indexes with the given column name; if the col...
SqlUtil::AbstractTable::getSqlValue
string getSqlValue(auto v)
returns a string for use in SQL queries representing the DB-specific value of the argument
SqlUtil::Columns
column container class that throws an exception if an unknown column is accessed
Definition: SqlUtil.qm.dox.h:5560
SqlUtil::AbstractTable::truncateNoCommit
deprecated truncateNoCommit()
A legacy warpper for truncate()
SqlUtil::Indexes
index container class that throws an exception if an unknown index is accessed
Definition: SqlUtil.qm.dox.h:5771
SqlUtil::AbstractTable::getDbType
AbstractDataProviderType getDbType(string native_type, *string qore_type, bool nullable, int max_size=-1, *hash< SqlUtilDataTypeOptionInfo > options)
returns the DB type for the given column type
SqlUtil::AbstractTable
the base abstract class for the table implementation
Definition: AbstractTable.qc.dox.h:36
SqlUtil::AbstractTable::delCommit
int delCommit()
SqlUtil::AbstractTable::delCommit() variant
SqlUtil::AbstractTable::dropCommit
dropCommit(*hash< auto > opt)
drops the table from the database; releases the transaction lock after dropping the table
SqlUtil::AbstractTable::UpsertResultDescriptionMap
const UpsertResultDescriptionMap
hash mapping upsert descriptions to codes
Definition: AbstractTable.qc.dox.h:362
SqlUtil::AbstractTable::getSavepointHelperImpl
abstract AbstractSavepointHelper getSavepointHelperImpl(*string savepoint)
get DB-specific savepoint helper
SqlUtil::AbstractTable::insertFromSelect
int insertFromSelect(list cols, AbstractTable source, hash< auto > sh, reference< string > sql, hash< auto > opt)
inserts rows into a table based on a select statement from another table (which must be using the sam...
SqlUtil::AbstractTable::getTypeMapImpl
abstract hash< auto > getTypeMapImpl()
returns the type name -> type description hash
SqlUtil::AbstractTable::getInsertOptions
hash< auto > getInsertOptions()
returns the insert options for this driver
SqlUtil::AbstractTable::getRawUpdateOperatorMap
hash< auto > getRawUpdateOperatorMap()
returns the raw (default) update operator map for this object
SqlUtil::AbstractTable::getAddColumnSql
list< auto > getAddColumnSql(string cname, hash copt, bool nullable=True, *hash< auto > opt)
returns a list of SQL strings that can be use to add a column to the table
SqlUtil::AbstractTable::getAddPrimaryKeySql
string getAddPrimaryKeySql(string pkname, softlist cols, *hash pkopt, *hash< auto > opt)
returns the SQL that can be used to add a primary key to the table
SqlUtil::AbstractTable::getUniqueConstraintIterator
Qore::AbstractIterator getUniqueConstraintIterator()
returns an iterator for all unique constraints on the table (including the primary key if any)
hash
hash< auto > hash(object obj)
SqlUtil::AbstractTable::dropColumn
AbstractColumn dropColumn(string cname, *reference lsql)
drops a column from the table
SqlUtil::AbstractColumnSupportingConstraint
the API for a constraint with columns
Definition: SqlUtil.qm.dox.h:6016
SqlUtil::AbstractTable::native_case
bool native_case
native case option
Definition: AbstractTable.qc.dox.h:395
SqlUtil::AbstractTable::getCreateSql
list< auto > getCreateSql(*hash< auto > opt)
returns a list of SQL strings that could be used to create the table and all known properties of the ...
SqlUtil::AbstractTable::getModifyColumnSql
list< auto > getModifyColumnSql(string cname, hash copt, bool nullable=True, *hash< auto > opt)
gets a list of SQL strings that can be used to modify an existing column in the table
SqlUtil::Triggers
trigger container class that throws an exception if an unknown trigger is accessed
Definition: SqlUtil.qm.dox.h:6403
SqlUtil::AbstractTable::insertFromIteratorCommit
int insertFromIteratorCommit(Qore::AbstractIterator i, *hash< auto > opt)
this method inserts data from the given iterator argument (whose getValue() method must return a hash...
SqlUtil::AbstractTable::getColumnOperatorMap
hash< auto > getColumnOperatorMap()
returns the column operator map for this object
NothingType
const NothingType
SqlUtil::AbstractTable::getConstraints
Constraints getConstraints()
returns a Constraints object describing the non-foreign constraints on the table
SqlUtil::AbstractTable::getColumnSqlNames
list< auto > getColumnSqlNames(softlist cols)
returns a list of column names for use in SQL strings; subclasses can process the argument list in ca...
SqlUtil::AbstractTable::getColumnDescOptions
hash< auto > getColumnDescOptions()
returns the column description options for this driver
SqlUtil::AbstractTable::getBulkUpsertClosure
code getBulkUpsertClosure(hash example_row, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
returns a closure that can be executed given a hash argument representing either a single row or a se...
SqlUtil::AbstractTable::getUpsertClosureWithValidation
code getUpsertClosureWithValidation(hash example_row, int upsert_strategy=UpsertAuto, *hash< auto > opt)
returns a closure that can be executed given a hash argument representing a single row that will be u...
join
string join(string str,...)
SqlUtil::AbstractTable::tryExec
auto tryExec(string sql)
executes some SQL with optional arguments so that if an error occurs the current transaction state is...
SqlUtil::AbstractTable::getColumnDataType
AbstractDataProviderType getColumnDataType(string column_name, *hash< SqlUtilDataTypeOptionInfo > options)
returns the data type for the given column
SqlUtil::AbstractTable::InsertFromIteratorOptions
const InsertFromIteratorOptions
default insert option keys
Definition: AbstractTable.qc.dox.h:237
SqlUtil::AbstractTable::hasReturningImpl
bool hasReturningImpl()
returns True if the current database driver supports the "returning" clause in insert statements,...
SqlUtil::AbstractTable::getColumnOperatorMapImpl
*hash< auto > getColumnOperatorMapImpl()
Reimplement in subclasses to provide driver specific column operators.
SqlUtil::AbstractTable::ForeignConstraintOptions
const ForeignConstraintOptions
default foreign constraint options
Definition: AbstractTable.qc.dox.h:73
SqlUtil::AbstractTable::getDropIndexSql
string getDropIndexSql(string iname, *hash< auto > opt)
gets the SQL that can be used to drop an index from the table
SqlUtil::AbstractTable::getConstraintOptions
hash< auto > getConstraintOptions()
returns the constraint options for this driver
SqlUtil::AbstractTable::upsertFromSelect
*hash upsertFromSelect(AbstractTable t, *hash< auto > sh, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
this method upserts or merges data from the given foreign table and select option hash into the curre...
SqlUtil::AbstractTable::insertCommit
*hash< auto > insertCommit(hash< auto > row)
inserts a row into the table; the transaction is committed if successful, if an error occurs,...
SqlUtil::AbstractPrimaryKey
represents a primary key
Definition: SqlUtil.qm.dox.h:6110
SqlUtil::AbstractDatabase::CreationOptions
const CreationOptions
default generic creation options
Definition: AbstractDatabase.qc.dox.h:165
False
const False
SqlUtil::AbstractTable::insertFromSelectNoCommit
deprecated int insertFromSelectNoCommit(list cols, AbstractTable source, *hash< auto > sh, *reference< string > sql, *hash< auto > opt)
A legacy SqlUtil::AbstractTable::insertFromSelect() wrapper.
SqlUtil::AbstractTable::drop
drop(*hash< auto > opt)
drops the table from the database without any transaction management
SqlUtil::AbstractTable::addCustomCopOperator
addCustomCopOperator(string name, hash< auto > operator)
register custom user column operator for this table object
SqlUtil::AbstractTable::empty
bool empty()
returns True if the table has no definitions, False if not
SqlUtil::AbstractTable::validateColumnOptions
validateColumnOptions(string cname, reference< hash > opt, bool nullable)
validates column options
SqlUtil::AbstractTable::getRowIteratorNoExec
Qore::SQL::SQLStatement getRowIteratorNoExec(*hash< auto > sh, *reference< string > sql, *hash< auto > opt)
returns an SQLStatement object that will iterate the results of a select statement matching the argum...
SqlUtil::AbstractTable::getCreateMiscSql
*list< auto > getCreateMiscSql(*hash< auto > opt, bool cache=True)
returns a list of SQL strings that could be used to create other table attributes (such as comments,...
SqlUtil::AbstractTable::getQoreTypeMapImpl
abstract hash< auto > getQoreTypeMapImpl()
returns the qore type -> column type map
SqlUtil::AbstractTable::UpsertUpdateFirst
const UpsertUpdateFirst
Upsert option: update first, if the update fails, then insert.
Definition: AbstractTable.qc.dox.h:271
SqlUtil::AbstractTable::truncateCommit
truncateCommit()
truncates all the table data; releases the transaction lock after executing
SqlUtil::AbstractTable::getAlignTableOptions
hash< auto > getAlignTableOptions()
returns the align table options for this driver
SqlUtil::AbstractTable::addTrigger
AbstractTrigger addTrigger(string tname, string src, *hash< auto > opt, *reference lsql)
adds a trigger to the table; if the table is already known to be in the database, then it is added in...
SqlUtil::AbstractTable::getAlignSql
list< auto > getAlignSql(AbstractTable t, *hash< auto > opt)
accepts an AbstractTable argument and returns a list of SQL strings required to align the structure a...
SqlUtil::AbstractTable::addForeignConstraint
AbstractForeignConstraint addForeignConstraint(string cname, softlist cols, string table, *softlist tcols, *hash< auto > opt, *reference< string > sql)
adds a foreign constraint to the table; if the table is already known to be in the database,...
SqlUtil::Constraints
constraint container class that throws an exception if an unknown constraint is accessed
Definition: SqlUtil.qm.dox.h:5886
SqlUtil::AbstractTable::getColumnSqlName
string getColumnSqlName(string col)
returns the column name for use in SQL strings; subclasses can return a special string in case the co...
SqlUtil::AbstractTable::getCreateIndexesSql
*list< auto > getCreateIndexesSql(*hash< auto > opt, bool cache=True)
returns a list of SQL strings that could be used to create indexes on the table or NOTHING if there a...
SqlUtil
Qore AbstractDatabase class definition.
Definition: AbstractDatabase.qc.dox.h:32
SqlUtil::AbstractTable::getTriggers
Triggers getTriggers()
returns an object of class Triggers describing the triggers on the table
SqlUtil::AbstractTable::getCreatePrimaryKeySql
*string getCreatePrimaryKeySql(*hash< auto > opt, bool cache=True)
returns an SQL string that could be used to create the primary key on the table
SqlUtil::Tables
the table container class stores a collection of tables in a schema
Definition: SqlUtil.qm.dox.h:5374
SqlUtil::AbstractTable::describe
Columns describe()
returns an object of class Columns describing the table
SqlUtil::AbstractTable::getRenameSql
string getRenameSql(string new_name, *hash< auto > opt)
returns an SQL string that could be used to rename the table in the database
SqlUtil::AbstractTable::upsert
int upsert(hash< auto > row, int upsert_strategy=UpsertAuto, *hash< auto > opt)
update or insert the data in the table according to the hash argument; the table must have a unique k...
Qore::SQL::AbstractSQLStatement
SqlUtil::AbstractTable::constructor
constructor(AbstractDatasource nds, string nname, *hash nopts)
creates the object; private constructor
SqlUtil::AbstractTable::name
string name
the table's name
Definition: AbstractTable.qc.dox.h:381
SqlUtil::AbstractTable::UpsertOptions
const UpsertOptions
default upsert option keys
Definition: AbstractTable.qc.dox.h:225
SqlUtil::AbstractTable::AlignTableOptions
const AlignTableOptions
table alignment options
Definition: AbstractTable.qc.dox.h:126
SqlUtil::AbstractTable::getStatementNoExec
Qore::SQL::AbstractSQLStatement getStatementNoExec(*hash< auto > sh, *reference< string > sql, *hash< auto > opt)
returns an AbstractSQLStatement object that will iterate the results of a select statement matching t...
SqlUtil::AbstractTable::getSqlValueImpl
abstract *string getSqlValueImpl(auto v)
returns a string for use in SQL queries representing the DB-specific value of the argument; returns N...
SqlUtil::AbstractTable::renameConstraint
AbstractConstraint renameConstraint(string old_name, string new_name, reference lsql)
renames an existing constraint; this can be any constraint on the table, a primary key,...
SqlUtil::AbstractTable::modifyColumn
AbstractColumn modifyColumn(string cname, hash< auto > opt, bool nullable=True, *reference lsql)
modifies an existing column in the table; if the table is already known to be in the database,...
SqlUtil::AbstractTable::getDesc
string getDesc()
returns a descriptive string of the datasource (without the password) and the table name (with a poss...
SqlUtil::AbstractTable::getTriggerOptions
hash< auto > getTriggerOptions()
returns the trigger options for this driver
SqlUtil::AbstractTable::tryExecRawImpl
auto tryExecRawImpl(string sql)
tries to execute a command so that if an error occurs the current transaction status is not lost
SqlUtil::AbstractTable::UpsertUpdateOnly
const UpsertUpdateOnly
Upsert option: update if the row exists, otherwise ignore.
Definition: AbstractTable.qc.dox.h:301
SqlUtil::AbstractTable::upsertFromSelectCommit
*hash upsertFromSelectCommit(AbstractTable t, *hash< auto > sh, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt)
this method upserts or merges data from the given foreign table and select option hash into the curre...
SqlUtil::AbstractTable::getForeignConstraints
ForeignConstraints getForeignConstraints(*hash< auto > opt)
returns a ForeignConstraints object describing the foreign constraints that the table has on other ta...
SqlUtil::AbstractSqlUtilBase::l
transient Mutex l()
mutex for atomic actions
SqlUtil::AbstractTable::getSavepointHelper
AbstractSavepointHelper getSavepointHelper(*string savepoint)
get DB-specific savepoint helper
Qore::AbstractIterator
SqlUtil::AbstractTable::getUpdateOperatorMap
hash< auto > getUpdateOperatorMap()
returns the update operator map for this object
SqlUtil::AbstractTable::insertFromIterator
int insertFromIterator(Qore::AbstractIterator i, *hash< auto > opt)
this method inserts data from the given iterator argument (whose getValue() method must return a hash...
SqlUtil::AbstractTable::getSelectOptions
hash< auto > getSelectOptions()
returns the select options for this driver
SqlUtil::AbstractTable::getAddCheckConstraintSql
string getAddCheckConstraintSql(string cname, string src, *hash copt, *hash< auto > opt)
returns an SQL string that can be used to add a check constraint to the table
SqlUtil::AbstractConstraint
abstract base class for constraints
Definition: SqlUtil.qm.dox.h:5928
SqlUtil::AbstractTable::CacheOptions
const CacheOptions
default cache options
Definition: AbstractTable.qc.dox.h:65
SqlUtil::AbstractTable::foreignConstraints
ForeignConstraints foreignConstraints
foreign constraints description
Definition: AbstractTable.qc.dox.h:389
SqlUtil::AbstractTable::getAddForeignConstraintSql
string getAddForeignConstraintSql(string cname, softlist cols, string table, *softlist tcols, *hash fkopt, *hash< auto > opt)
returns an SQL string that can be used to add a foreign constraint to the table
SqlUtil::AbstractTable::doSelectOrderByWithOffsetSqlUnlockedImpl
abstract doSelectOrderByWithOffsetSqlUnlockedImpl(reference< string > sql, reference< list< auto >> args, *hash< auto > qh, *hash< auto > jch, *hash< auto > ch, *hash< auto > psch, list coll)
processes a string for use in SQL select statements when there is an "order by" and "offset" argument
SqlUtil::AbstractTable::dropConstraint
AbstractConstraint dropConstraint(string cname, *reference< string > sql)
drops a constraint from the table; this can be any constraint on the table, a primary key,...
Hash
const Hash
SqlUtil::AbstractTable::getCreateSqlString
string getCreateSqlString(*hash< auto > opt)
returns an SQL string that could be used to create the table and all known properties of the table
SqlUtil::AbstractTable::addCheckConstraint
AbstractCheckConstraint addCheckConstraint(string cname, string src, *hash< auto > opt, *reference< string > sql)
adds a check constraint to the table; if the table is already known to be in the database,...
SqlUtil::AbstractTable::selectRows
*list selectRows(*hash< auto > sh, *reference< string > sql, *hash< auto > opt)
returns a list of hashes representing the rows in the table that match the argument hash
SqlUtil::AbstractTable::dropTrigger
AbstractTrigger dropTrigger(string tname, *reference< string > sql)
drops the given trigger from the table; if the table is known to be in the database already,...
SqlUtil::AbstractTable::getCreateForeignConstraintsSql
*list< auto > getCreateForeignConstraintsSql(*hash< auto > opt, bool cache=True)
returns a list of SQL strings that could be used to create foreign constraints on the table or NOTHIN...
SqlUtil::AbstractTable::getAlignSqlString
string getAlignSqlString(AbstractTable t, *hash< auto > opt)
accepts an AbstractTable argument and returns an SQL string that could be executed to align the struc...
SqlUtil::AbstractTable::getDropSql
softlist< auto > getDropSql(*hash< auto > opt)
returns the sql required to drop the table; reimplement in subclasses if necessary
SqlUtil::AbstractTable::getNumericTypeImpl
abstract AbstractDataProviderType getNumericTypeImpl(string type_name, bool nullable, *hash< auto > options)
returns the type for number / numeric columns for the database so that data conversions can be handle...
SqlUtil::AbstractTable::emptyData
bool emptyData()
returns True if the table has no data rows, False if not
SqlUtil::AbstractTable::getBaseType
string getBaseType()
returns the base type of the underlying object (normally "table", some DB-specific implementations ma...
SqlUtil::AbstractTable::getAddTriggerSql
list< auto > getAddTriggerSql(string tname, string src, *hash topt, *hash< auto > opt)
returns a list of SQL strings that can be used to add a trigger to the table
SqlUtil::AbstractTable::hasArrayBind
abstract bool hasArrayBind()
returns True if the underlying DB driver supports bulk DML operations
SqlUtil::AbstractTable::indexes
Indexes indexes
index descriptions
Definition: AbstractTable.qc.dox.h:387
Int
const Int
SqlUtil::AbstractTable::getRenameColumnSql
string getRenameColumnSql(string old_name, string new_name, *hash< auto > opt)
gets an SQL string that can be used to rename an existing column in the table
SqlUtil::AbstractTable::clear
clear()
purges the current table definition
Boolean
const Boolean