Qore SqlUtil Module Reference  1.8.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  private AbstractColumn addColumnUnlocked(string cname, hash<auto> opt, bool nullable = True, *reference lsql,
794  bool do_exec = True, bool modify_table = True) {
795  if (!columns)
796  columns = new Columns();
797  else if (columns.hasKey(cname))
798  throw "COLUMN-ERROR", sprintf("%s column %y: this column already exists", getDesc(), cname);
799 
800  if (!opt.native_type && !opt.qore_type)
801  throw "COLUMN-ERROR", sprintf("%s column %y: no native_type or qore_type keys in column option hash: %y",
802  getDesc(), cname, opt);
803 
804  validateColumnOptions(cname, \opt, nullable);
805 
806  // get the new column object
807  AbstractColumn c = addColumnImpl(cname, opt, nullable);
808 
809  // add column in table if the table is already known to be in the database
810  lsql = c.getAddColumnSql(self);
811  if (do_exec)
812  execSql(lsql);
813 
814  // add the column to the internal column representation
815  if (modify_table)
816  addColumnToTableUnlocked(c);
817 
818  return c;
819  }
820 
821 protected:
822  addColumnToTableUnlocked(AbstractColumn c);
823 public:
824 
825 
827 
852  AbstractColumn modifyColumn(string cname, hash<auto> opt, bool nullable = True, *reference lsql);
853 
854 
856 
883  list<auto> getModifyColumnSql(string cname, hash<auto> copt, bool nullable = True, *hash<auto> opt);
884 
885 
887 
904  AbstractColumn renameColumn(string old_name, string new_name, reference<string> sql);
905 
906 
908 
926  string getRenameColumnSql(string old_name, string new_name, *hash<auto> opt);
927 
928 
929 protected:
930  AbstractColumn renameColumnIntern(AbstractColumn c, string new_name);
931 public:
932 
933 
934 protected:
935  validateOptionsIntern(string err, hash<auto> ropt, reference<hash<auto>> opt);
936 public:
937 
938 
939 protected:
940  validateOptionsIntern(string err, hash<auto> ropt, reference<hash<auto>> opt, string tag);
941 public:
942 
943 
944 protected:
945  execSql(softlist lsql);
946 public:
947 
948 
950 
970  AbstractPrimaryKey addPrimaryKey(string pkname, softlist cols, *hash<auto> opt, *reference<string> sql);
971 
972 
974 
996  string getAddPrimaryKeySql(string pkname, softlist cols, *hash pkopt, *hash<auto> opt);
997 
998 
999 protected:
1000  setPrimaryKeyUnlocked(AbstractPrimaryKey pk);
1001 public:
1002 
1003 
1004 protected:
1005  AbstractPrimaryKey addPrimaryKeyUnlocked(string pkname, softlist cols, *hash<auto> opt, *reference<string> sql);
1006 public:
1007 
1008 
1009 protected:
1010  AbstractPrimaryKey addPrimaryKeyUnlockedIntern(string pkname, softlist cols, *hash<auto> opt, *reference<string> sql);
1011 public:
1012 
1013 
1015 
1031  list<auto> getDropAllConstraintsAndIndexesOnColumnSql(string cname, *hash<auto> opt);
1032 
1033 
1034 protected:
1035  list<auto> getDropAllConstraintsAndIndexesOnColumnSqlUnlocked(string cname, *hash<auto> opt);
1036 public:
1037 
1038 
1040 
1059  list<auto> getDropPrimaryKeySql(*hash<auto> opt);
1060 
1061 
1063 
1082 
1083 
1085 
1106  AbstractUniqueConstraint addUniqueConstraint(string cname, softlist cols, *hash<auto> opt, *reference<string> sql);
1107 
1108 
1110 
1130  string getAddUniqueConstraintSql(string cname, softlist cols, *hash ukopt, *hash<auto> opt);
1131 
1132 
1133 protected:
1134  AbstractUniqueConstraint addUniqueConstraintUnlocked(string cname, softlist cols, *hash<auto> opt, *reference<string> sql);
1135 public:
1136 
1137 
1138 protected:
1139  AbstractUniqueConstraint addUniqueConstraintUnlockedIntern(string cname, softlist cols, *hash<auto> opt, *reference<string> sql);
1140 public:
1141 
1142 
1144 
1165  AbstractIndex addIndex(string iname, bool unique, softlist cols, *hash<auto> opt, *reference<string> sql);
1166 
1167 
1169 
1190  string getAddIndexSql(string iname, bool unique, softlist cols, *hash<auto> ixopt, *hash<auto> opt);
1191 
1192 
1193 protected:
1194  AbstractIndex addIndexUnlocked(string iname, bool unique, softlist cols, *hash<auto> opt, *reference<string> sql);
1195 public:
1196 
1197 
1198 protected:
1199  AbstractIndex addIndexUnlockedIntern(string iname, bool unique, softlist cols, *hash<auto> opt, *reference<string> sql);
1200 public:
1201 
1202 
1204 
1216  AbstractIndex renameIndex(string old_name, string new_name, reference<string> sql);
1217 
1218 
1220 
1238  AbstractIndex dropIndex(string iname, *reference<string> sql);
1239 
1240 
1242 
1261  string getDropIndexSql(string iname, *hash<auto> opt);
1262 
1263 
1265 
1287  AbstractForeignConstraint addForeignConstraint(string cname, softlist cols, string table, *softlist tcols, *hash<auto> opt, *reference<string> sql);
1288 
1289 
1291 
1313  string getAddForeignConstraintSql(string cname, softlist cols, string table, *softlist tcols, *hash fkopt, *hash<auto> opt);
1314 
1315 
1316 protected:
1317  Columns getReferencedTableColumnsUnlocked(string table, *Tables cache, string err = 'FOREIGN-CONSTRAINT-ERROR');
1318 public:
1319 
1320 
1321 protected:
1322  AbstractForeignConstraint addForeignConstraintUnlocked(string cname, softlist cols, string table, *softlist tcols, *hash<auto> opt, *reference<string> sql);
1323 public:
1324 
1325 
1326 protected:
1327  AbstractForeignConstraint addForeignConstraintUnlockedIntern(string cname, softlist cols, string table, *softlist tcols, *hash<auto> opt, *reference<string> sql);
1328 public:
1329 
1330 
1332 
1350  AbstractForeignConstraint dropForeignConstraint(string cname, *reference<string> sql);
1351 
1352 
1354 
1370 
1371 
1373 
1393  AbstractCheckConstraint addCheckConstraint(string cname, string src, *hash<auto> opt, *reference<string> sql);
1394 
1395 
1397 
1419  string getAddCheckConstraintSql(string cname, string src, *hash copt, *hash<auto> opt);
1420 
1421 
1422 protected:
1423  AbstractCheckConstraint addCheckConstraintUnlocked(string cname, string src, *hash<auto> opt, *reference<string> sql);
1424 public:
1425 
1426 
1427 protected:
1428  AbstractCheckConstraint addCheckConstraintUnlockedIntern(string cname, string src, *hash<auto> opt, *reference<string> sql);
1429 public:
1430 
1431 
1433 
1445  AbstractConstraint renameConstraint(string old_name, string new_name, reference lsql);
1446 
1447 
1449 
1468  string getDropConstraintSql(string cname, *hash<auto> opt);
1469 
1470 
1472 
1491  *string getDropConstraintIfExistsSql(string cname, *hash<auto> opt, *reference<AbstractConstraint> cref);
1492 
1493 
1494 protected:
1495  AbstractConstraint findDropConstraintUnlocked(string cname, reference<code> rmv);
1496 public:
1497 
1498 
1500 
1518  AbstractConstraint dropConstraint(string cname, *reference<string> sql);
1519 
1520 
1522 
1542  AbstractTrigger addTrigger(string tname, string src, *hash<auto> opt, *reference lsql);
1543 
1544 
1546 
1568  list<auto> getAddTriggerSql(string tname, string src, *hash topt, *hash<auto> opt);
1569 
1570 
1571 protected:
1572  AbstractTrigger addTriggerUnlocked(string tname, string src, *hash<auto> opt, *reference lsql);
1573 public:
1574 
1575 
1576 protected:
1577  AbstractTrigger addTriggerUnlockedIntern(string tname, string src, *hash<auto> opt, *reference lsql);
1578 public:
1579 
1580 
1582 
1600  AbstractTrigger dropTrigger(string tname, *reference<string> sql);
1601 
1602 
1604 
1623  list<auto> getDropTriggerSql(string tname, *hash<auto> opt);
1624 
1625 
1626 protected:
1627  getAllConstraintsUnlocked(*hash<auto> opt);
1628 public:
1629 
1630 
1631 protected:
1632  checkUniqueConstraintName(string err, string cname);
1633 public:
1634 
1635 
1636 protected:
1637  checkUniqueConstraintNameValidateOptions(string err, string cname, hash<auto> ropt, reference<hash> opt);
1638 public:
1639 
1640 
1642 protected:
1643  validateColumnOptions(string cname, reference<hash> opt, bool nullable);
1644 public:
1645 
1646 
1648 
1666  AbstractColumn dropColumn(string cname, *reference lsql);
1667 
1668 
1670 
1689  list<auto> getDropColumnSql(string cname, *hash<auto> opt);
1690 
1691 
1693 
1704  *hash<auto> insertCommit(hash<auto> row);
1705 
1706 
1708 
1712  *hash<auto> insertCommit(hash<auto> row, reference<string> sql);
1713 
1714 
1716 
1720  *hash<auto> insertCommit(hash<auto> row, hash<auto> opt);
1721 
1722 
1724 
1729  *hash<auto> insertCommit(hash<auto> row, reference<string> sql, hash<auto> opt);
1730 
1731 
1733 
1745  *hash<auto> insert(hash<auto> row);
1746 
1747 
1749 
1753  *hash<auto> insert(hash<auto> row, reference<string> sql);
1754 
1755 
1757 
1761  *hash<auto> insert(hash<auto> row, hash<auto> opt);
1762 
1763 
1765 
1770  *hash<auto> insert(hash<auto> row, reference<string> sql, hash<auto> opt);
1771 
1772 
1774 
1783  hash<SqlResultInfo> insertWithInfo(hash<auto> row, *hash<auto> opt);
1784 
1785 
1787  deprecated *hash<auto> insertNoCommit(hash<auto> row, *reference<string> sql, *hash<auto> opt);
1788 
1790  deprecated *hash<auto> insertNoCommit(hash<auto> row, hash<auto> opt);
1791 
1792  private *hash<auto> insertIntern(hash<auto> row, *reference<string> sql, *hash<auto> opt,
1793  *reference<softlist<auto>> args) {
1794  // check data callback options if any
1795  validateOptionsIntern("OPTION-ERROR", getInsertOptions(), \opt);
1796 
1797  // issue #3352: do not execute runtime DML while holding the lock
1798  {
1799  l.lock();
1800  on_exit l.unlock();
1801 
1802  getColumnsUnlocked();
1803  }
1804  sql = sprintf("insert into %s (", getSqlName());
1805  foreach string k in (keys row);
1806 
1807  hash vh = getPlaceholdersAndValues(row);
1808 
1809  sql += (foldl $1 + "," + $2, (map getColumnSqlName($1), keys row));
1810  sql += ") values (";
1811  sql += (foldl $1 + "," + $2, vh.placeholders);
1812  sql += ")";
1813 
1814  args = vh.values;
1815 
1816  // check for a bulk insert in case the driver does not support array binding
1817  if (!hasArrayBind());
1818 
1819 
1820  if (opt.returning)
1821  return doReturningImpl(opt, \sql, args);
1822 
1823  execData(opt, sql, args);
1824  }
1825 
1826 protected:
1827  hash<auto> getPlaceholdersAndValues(hash<auto> row);
1828 public:
1829 
1830 
1832 
1836 
1837 
1839 
1858  int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh, reference<string> sql, hash<auto> opt);
1859 
1860 
1863 
1864 
1866  int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh);
1867 
1868 
1870  int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh, reference<string> sql);
1871 
1872 
1874  int insertFromSelectCommit(list cols, AbstractTable source, hash<auto> sh, hash<auto> opt);
1875 
1876 
1878 
1897  int insertFromSelect(list cols, AbstractTable source, hash<auto> sh, reference<string> sql, hash<auto> opt);
1898 
1899 
1902 
1903 
1905  int insertFromSelect(list cols, AbstractTable source, hash<auto> sh);
1906 
1907 
1909  int insertFromSelect(list cols, AbstractTable source, hash<auto> sh, reference<string> sql);
1910 
1911 
1913  int insertFromSelect(list cols, AbstractTable source, hash<auto> sh, hash<auto> opt);
1914 
1915 
1917 
1930  hash<SqlResultInfo> insertFromSelectWithInfo(list<auto> cols, AbstractTable source, hash<auto> select_hash,
1931  *hash<auto> opt) {
1932  hash<SqlResultInfo> rv();
1933  rv.result = insertFromSelectIntern(cols, source, select_hash, \rv.sql, opt, \rv.args);
1934  return rv;
1935  }
1936 
1938  deprecated int insertFromSelectNoCommit(list cols, AbstractTable source, *hash<auto> sh, *reference<string> sql,
1939  *hash<auto> opt) {
1940  return insertFromSelectIntern(cols, source, sh, \sql, opt);
1941  }
1942 
1943  private int insertFromSelectIntern(list cols, AbstractTable source, *hash<auto> sh, *reference<string> sql,
1944  *hash<auto> opt, *reference<softlist<auto>> args) {
1945  string ssql = source.getSelectSql(sh, \args);
1946 
1947  // issue #3352: do not execute runtime DML while holding the lock
1948  {
1949  l.lock();
1950  on_exit l.unlock();
1951 
1952  getColumnsUnlocked();
1953  }
1954 
1955  sql = sprintf("insert into %s (", getSqlName());
1956 
1957  foreach string k in (cols);
1958 
1959 
1960  sql += (foldl $1 + "," + $2, getColumnSqlNames(cols));
1961  sql += ") " + ssql;
1962 
1963  return execData(opt, sql, args);
1964  }
1965 
1967 
1986 
1987 
1989 
2008 
2009 
2011  deprecated int insertFromIteratorNoCommit(Qore::AbstractIterator i, *hash<auto> opt);
2012 
2013 protected:
2014  int insertFromIteratorIntern(Qore::AbstractIterator i, *hash<auto> opt);
2015 public:
2016 
2017 
2019 
2035  int upsertCommit(hash<auto> row, int upsert_strategy = UpsertAuto, *hash<auto> opt);
2036 
2037 
2039 
2055  int upsert(hash<auto> row, int upsert_strategy = UpsertAuto, *hash<auto> opt);
2056 
2057 
2059  deprecated int upsertNoCommit(hash<auto> row, int upsert_strategy = UpsertAuto);
2060 
2062 
2083  code getUpsertClosure(hash<auto> row, int upsert_strategy = UpsertAuto, *hash<auto> opt);
2084 
2085 
2087 
2114  code getBulkUpsertClosure(hash<auto> example_row, int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt);
2115 
2116 
2118 
2139  code getUpsertClosureWithValidation(hash<auto> example_row, int upsert_strategy = UpsertAuto, *hash<auto> opt);
2140 
2141 
2143 
2176  int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt) {
2177  on_success ds.commit();
2178  on_error ds.rollback();
2179 
2180  return upsertFromIteratorIntern(i, upsert_strategy, opt);
2181  }
2182 
2184 
2216  *hash<string, int> upsertFromIterator(Qore::AbstractIterator i, int upsert_strategy = AbstractTable::UpsertAuto,
2217  *hash<auto> opt) {
2218  return upsertFromIteratorIntern(i, upsert_strategy, opt - "commit_block");
2219  }
2220 
2222  deprecated *hash<string, int> upsertFromIteratorNoCommit(Qore::AbstractIterator i,
2223  int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt) {
2224  return upsertFromIteratorIntern(i, upsert_strategy, opt - "commit_block");
2225  }
2226 
2227  private *hash<string, int> upsertFromIteratorIntern(Qore::AbstractIterator i,
2228  int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt) {
2229  // check upsert options
2230  validateOptionsIntern("OPTION-ERROR", getUpsertOptions(), \opt);
2231 
2232  // try to get initial row
2233  if (!i.next());
2234 
2235 
2236  // result hash
2237  hash<string, int> rh;
2238 
2239  // primary key value hash for "delete_others"
2240  hash<string, bool> pkh;
2241 
2242  hash<auto> row = i.getValue();
2243  code upsert = getUpsertClosure(row, upsert_strategy, opt);
2244 
2245  opt.change_count = 0;
2246  do {
2247  int code = upsert(row);
2248  ++rh{AbstractTable::UpsertResultMap{code}};
2249  if (opt.info_callback) {
2250  opt.info_callback(getSqlName(), row, code);
2251  }
2252 
2253  if (code != UR_Unchanged && opt.commit_block) {
2254  if (++opt.change_count >= opt.commit_block) {
2255  ds.commit();
2256  opt.change_count = 0;
2257  }
2258  }
2259 
2260  // save primary key value in primary key hash if "delete_others" is set
2261  if (opt.delete_others) {
2262  pkh{foldl $1 + "-" + $2, (map row.$1.toString(), primaryKey.keyIterator())} = True;
2263  }
2264  } while (i.next() && (row = i.getValue()));
2265 
2266  if (opt.delete_others);
2267 
2268 
2269  return rh;
2270  }
2271 
2272 protected:
2273  *hash<string, int> doDeleteOthersIntern(hash<auto> pkh, *hash<auto> opt);
2274 public:
2275 
2276 
2278 
2340  *hash<string, int> upsertFromSelectCommit(AbstractTable t, *hash<auto> sh,
2341  int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt) {
2342  on_success { ds.commit(); t.commit(); }
2343  on_error { ds.rollback(); t.rollback(); }
2344 
2345  return upsertFromSelect(t, sh, upsert_strategy, opt);
2346  }
2347 
2349  *hash<string, int> upsertFromSelectCommit(Table t, *hash<auto> sh,
2350  int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt) {
2351  on_success { ds.commit(); t.commit(); }
2352  on_error { ds.rollback(); t.rollback(); }
2353 
2354  return upsertFromIteratorIntern(t.getStatement(sh), upsert_strategy, opt);
2355  }
2356 
2358 
2398  *hash<string, int> upsertFromSelect(AbstractTable t, *hash<auto> sh,
2399  int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt) {
2400  return upsertFromIteratorIntern(t.getStatement(sh), upsert_strategy, opt - "commit_block");
2401  }
2402 
2404  deprecated *hash<string, int> upsertFromSelectNoCommit(AbstractTable t, *hash<auto> sh,
2405  int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt) {
2406  return upsertFromIteratorIntern(t.getStatement(sh), upsert_strategy, opt - "commit_block");
2407  }
2408 
2410  deprecated *hash<string, int> upsertFromSelect(Table t, *hash<auto> sh,
2411  int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt) {
2412  return upsertFromIteratorIntern(t.getStatement(sh), upsert_strategy, opt - "commit_block");
2413  }
2414 
2416  deprecated *hash<string, int> upsertFromSelectNoCommit(Table t, *hash<auto> sh,
2417  int upsert_strategy = AbstractTable::UpsertAuto, *hash<auto> opt) {
2418  return upsertFromIteratorIntern(t.getStatement(sh), upsert_strategy, opt - "commit_block");
2419  }
2420 
2422 
2433  softint rowCount();
2434 
2435 
2437 
2458  Qore::SQL::SQLStatement getRowIterator(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2459 
2460 
2462 
2485  Qore::SQL::SQLStatement getRowIteratorNoExec(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2486 
2487 
2489 
2509  Qore::SQL::SQLStatement getRowIterator(*hash<auto> sh, *hash<auto> opt);
2510 
2511 
2513 
2535  Qore::SQL::AbstractSQLStatement getStatement(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2536 
2537 
2539 
2560  Qore::SQL::AbstractSQLStatement getStatement(*hash<auto> sh, *hash<auto> opt);
2561 
2562 
2564 
2596  hash<SqlResultInfo> getStatementWithInfo(*hash<auto> select_hash, *hash<auto> opt);
2597 
2598 
2600 
2622  Qore::SQL::AbstractSQLStatement getStatementNoExec(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2623 
2624 
2626 
2654  hash<SqlResultInfo> getStatementNoExecWithInfo(*hash<auto> select_hash, *hash<auto> opt);
2655 
2656 
2658 
2679  Qore::SQL::AbstractSQLStatement getStatementNoExec(*hash<auto> sh, *hash<auto> opt);
2680 
2681 
2682  private Qore::SQL::AbstractSQLStatement getStatementIntern(*hash<auto> sh, *reference<string> sql,
2683  *hash<auto> opt, *bool no_exec, *reference<softlist<auto>> args) {
2684  validateOptionsIntern("OPTION-ERROR", getSelectOptions(), \sh);
2685 
2686  sql = getSelectSqlIntern(sh, \args, opt);
2687 
2688  AbstractSQLStatement stmt = ds.getSQLStatement();
2689  stmt.prepare(sql);
2690  if (no_exec);
2691  else {
2692  execData(stmt, opt, args);
2693  }
2694 
2695  return stmt;
2696  }
2697 
2699 
2720  *hash<auto> selectRow(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2721 
2722 
2723  private *hash<auto> selectRowIntern(*hash<auto> sh, *reference<string> sql, *hash<auto> opt,
2724  *reference<softlist<auto>> args) {
2725  validateOptionsIntern("OPTION-ERROR", getSelectOptions(), \sh);
2726  // check data callback options if any
2727  validateOptionsIntern("OPTION-ERROR", getSqlDataCallbackOptions(), \opt);
2728 
2729  sql = getSelectSqlUnlocked(sh, \args, opt);
2730 
2731  if (opt.sqlarg_callback);
2732 
2733 
2734  bool rollback_on_error = False;
2735  if (sh.forupdate);
2736 
2737  on_error if (rollback_on_error)
2738  ds.rollback();
2739  return ds.vselectRow(sql, args);
2740  }
2741 
2743 
2769  hash<SqlResultInfo> selectRowWithInfo(*hash<auto> select_hash, *hash<auto> opt);
2770 
2771 
2773 
2793  *list<auto> selectRows(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2794 
2795 
2796  private *list<auto> selectRowsIntern(*hash<auto> sh, *reference<string> sql, *hash<auto> opt,
2797  *reference<softlist<auto>> args) {
2798  validateOptionsIntern("OPTION-ERROR", getSelectOptions(), \sh);
2799  // check data callback options if any
2800  validateOptionsIntern("OPTION-ERROR", getSqlDataCallbackOptions(), \opt);
2801 
2802  sql = getSelectSqlUnlocked(sh, \args, opt);
2803 
2804  if (opt.sqlarg_callback)
2805  opt.sqlarg_callback(sql, args);
2806 
2807  bool rollback_on_error = False;
2808  if (sh.forupdate);
2809 
2810  on_error if (rollback_on_error)
2811  ds.rollback();
2812 
2813  return ds.vselectRows(sql, args);
2814  }
2815 
2817 
2842  hash<SqlResultInfo> selectRowsWithInfo(*hash<auto> select_hash, *hash<auto> opt);
2843 
2844 
2846 
2865  *hash<auto> select(*hash<auto> sh, *reference<string> sql, *hash<auto> opt);
2866 
2867 
2868 protected:
2869  *hash<auto> selectIntern(*hash<auto> sh, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
2870 public:
2871 
2872 
2874 
2899  hash<SqlResultInfo> selectWithInfo(*hash<auto> select_hash, *hash<auto> opt);
2900 
2901 
2903 
2921  *hash<auto> selectRow(*hash<auto> sh, *hash<auto> opt);
2922 
2923 
2925 
2942  *list<auto> selectRows(*hash<auto> sh, *hash<auto> opt);
2943 
2944 
2946 
2963  *hash<auto> select(*hash<auto> sh, *hash<auto> opt);
2964 
2965 
2967 
2985  string getSelectSql(*hash<auto> sh, *reference<list<auto>> args);
2986 
2987 
2988  *AbstractUniqueConstraint matchAnyUnique(softlist<auto> cols);
2989 
2990 
2991  string getSelectSqlIntern(*hash<auto> qh, reference<list<auto>> args, *hash<auto> opt);
2992 
2993 
2994  string getSelectSqlUnlocked(*hash<auto> qh, reference<list<auto>> args, *hash<auto> opt);
2995 
2996 
2997  // column & table information must be retrieved before calling this method
2998  string getSelectSqlUnlockedIntern(*hash<auto> qh, string from, reference<list<auto>> args,
2999  *hash<string, bool> subquery_column_map, *hash<auto> opt, *hash<auto> pseudo_column_map) {
3000  hash<QueryInfo> info = <QueryInfo>{
3001  "table": self,
3002  // make sure query_hash stays "hash<auto>"
3003  "query_hash": {} + qh,
3004  "subquery_column_map": subquery_column_map,
3005  "query_options": opt,
3006  "pseudo_column_map": pseudo_column_map ?? ({} + getPseudoColumnHash()),
3007  "expression_map": getExpressionMap(),
3008 
3009  # backwards-compatibility
3010  "where_operator_map": getWhereOperatorMap(),
3011  "column_operator_map": getColumnOperatorMap(),
3012  "args": args ?? (),
3013  };
3014  on_success args = info.args;
3015 
3016  if (exists info.query_hash.offset);
3017 
3018  // do not overwrite args; could be used in a subquery
3019  if (!exists args);
3020 
3021 
3022  // resolve any table names in joins first
3023  map info.query_hash.join{$1.key}.table = getSubtableFromString($1.value.table, opt),
3024  info.query_hash.join.pairIterator(), $1.value.table.typeCode() == NT_STRING;
3025 
3026  // make a hash of aliases to tables when using joins
3027  info.join_map = cast<hash<string, AbstractTable>>(
3028  map {$1.alias ?? $1.table.getName() : $1.table}, info.query_hash.join.iterator()
3029  );
3030 
3031  // issue #1909: add an alias for the main table if present
3032  if (info.query_hash.alias);
3033 
3034 
3035  // if we have a "superquery" argument, then we need to track which columns are in this subquery in
3036  // subquery_column_map
3037 
3038  string cstr;
3039  // make query
3040  list<auto> coll = ();
3041  if (info.query_hash.columns);
3042  else {
3043  cstr = "*";
3044  }
3045 
3046  string sql = sprintf("select %s from %s", cstr, getFromIntern(from, info.query_hash));
3047  if (info.query_hash.alias);
3048 
3049 
3050  // process join specifications
3051  foreach auto js in (info.query_hash.join.iterator());
3052 
3053 
3054  getSelectWhereSqlUnlocked(\info, \sql);
3055 
3056  if (info.query_hash.groupby);
3057 
3058 
3059  if (info.query_hash.having);
3060 
3061 
3062  if (info.query_hash.orderby);
3063  else if (info.query_hash.limit);
3064 
3065 
3066  //printf("SQL: %s\nargs: %y\n", sql, args);
3067 
3068  if (info.query_hash.forupdate && !info.query_hash.superquery);
3069 
3070 
3071  // issue #4206: splice comments and hints into the SQL query string last
3072  if (info.query_hash.comment || info.query_hash.hint);
3073 
3074 
3075  if (info.query_hash.superquery);
3076 
3077 
3078  return sql;
3079  }
3080 
3082  AbstractTable getSubtableFromString(string table, *hash<auto> opt);
3083 
3084 
3085  string getExpressionArg(reference<hash<QueryInfo>> info, int role, auto arg,
3086  AbstractDataProviderType expected_type) {
3087  if (arg instanceof hash<DataProviderFieldReference>);
3088 
3089  if (arg instanceof hash<DataProviderExpression>);
3090 
3091 
3092  info.args += arg;
3093  return "%v";
3094  }
3095 
3096 protected:
3097  string getFromIntern(string from, *hash<auto> qh);
3098 public:
3099 
3100 
3101 protected:
3102  list<auto> getGroupByListUnlocked(hash<QueryInfo> info, list<auto> coll);
3103 public:
3104 
3105 
3106 protected:
3107  list<auto> getOrderByListUnlocked(hash<QueryInfo> info, list<auto> coll);
3108 public:
3109 
3110 
3111 protected:
3112  list<auto> getGroupOrderByListUnlocked(hash<QueryInfo> info, string key, list<auto> coll);
3113 public:
3114 
3115 
3116 protected:
3117  doForUpdate(reference<string> sql);
3118 public:
3119 
3120 
3121 protected:
3122  string getSelectSqlName(*hash<auto> qh);
3123 public:
3124 
3125 
3126 protected:
3127  string getColumnExpressionIntern(reference<hash<QueryInfo>> info, auto cvc);
3128 public:
3129 
3130 
3131 protected:
3132  string doColumnOperatorIntern(reference<hash<QueryInfo>> info, hash<auto> cvc);
3133 public:
3134 
3135 
3136 protected:
3137  string doColumnOperatorIntern(reference<hash<QueryInfo>> info, auto cop, auto arg, *string cve);
3138 public:
3139 
3140 
3141 protected:
3142  string getColumnNameIntern(hash<QueryInfo> info, string column_name);
3143 public:
3144 
3145 
3147 protected:
3149 public:
3150 
3151 
3152 protected:
3153  getSelectWhereSqlUnlocked(reference<hash<QueryInfo>> info, reference<string> sql);
3154 public:
3155 
3156 
3157  private *string getWhereClause(*hash<auto> cond, reference<list<auto>> args, *string cprefix,
3158  *hash<string, AbstractTable> join_map) {
3159  hash<QueryInfo> info = <QueryInfo>{
3160  "table": self,
3161  "query_hash": {
3162  "where": cond,
3163  },
3164  "args": args ?? (),
3165 
3166  "join_map": join_map,
3167  "pseudo_column_map": {} + getPseudoColumnHash(),
3168  "expression_map": getExpressionMap(),
3169 
3170  // backwards-compatibility
3171  "where_operator_map": getWhereOperatorMap(),
3172  "column_operator_map": getColumnOperatorMap(),
3173  };
3174  on_success args = info.args;
3175  l.lock();
3176  on_exit l.unlock();
3177  return getWhereClauseUnlocked(\info, info.query_hash."where", cprefix);
3178  }
3179 
3180  private *string getWhereExpressionUnlocked(reference<hash<QueryInfo>> info, hash<DataProviderExpression> cond,
3181  *string cprefix) {
3182  string sql = getExpressionUnlockedIntern(\info, ER_Search, cond, AbstractDataProviderTypeMap."bool");
3183  if (sql);
3184 
3185  }
3186 
3187  private *string getExpressionUnlockedIntern(reference<hash<QueryInfo>> info, int role,
3188  hash<DataProviderExpression> cond, AbstractDataProviderType expected_type) {
3189  *hash<auto> exp = info.expression_map{cond.exp};
3190  if (!exp);
3191 
3192 
3193  AbstractDataProvider::verifyExpression(role, exp.exp, LC_All, expected_type, cond);
3194  return exp.code(\info, role, cond.args);
3195  }
3196 
3197 protected:
3198  *string getWhereClauseUnlocked(reference<hash<QueryInfo>> info, *hash<auto> cond, *string cprefix);
3199 public:
3200 
3201 
3202 protected:
3203  *list<string> getWhereClauseIntern(reference<hash<QueryInfo>> info, *hash<auto> cond, *string cprefix);
3204 public:
3205 
3206 
3207 protected:
3208  string doWhereExpressionIntern(reference<hash<QueryInfo>> info, string cn, auto we);
3209 public:
3210 
3211 
3212  string getOrClause(reference<hash<QueryInfo>> info, list<auto> arglist);
3213 
3214 
3215  string getOrClause(reference<hash<QueryInfo>> info, hash<auto> arg);
3216 
3217 
3218 protected:
3219  doSelectOrderBySqlUnlocked(hash<QueryInfo> info, reference<string> sql, list<auto> coll);
3220 public:
3221 
3222 
3224 
3240  int delCommit(hash<auto> cond, reference<string> sql, hash<auto> opt);
3241 
3242 
3244  int delCommit(hash<auto> cond, hash<auto> opt);
3245 
3246 
3248  int delCommit(hash<auto> cond, reference<string> sql);
3249 
3250 
3252  int delCommit(hash<auto> cond);
3253 
3254 
3256  int delCommit();
3257 
3258 
3260 
3275  int del(hash<auto> cond, reference<string> sql, hash<auto> opt);
3276 
3277 
3279  int del(hash<auto> cond, hash<auto> opt);
3280 
3281 
3283  int del(hash<auto> cond, reference<string> sql);
3284 
3285 
3287  int del(hash<auto> cond);
3288 
3289 
3291  int del();
3292 
3293 
3295 
3309  hash<SqlResultInfo> delWithInfo(hash<auto> cond, *hash<auto> opt);
3310 
3311 
3313  deprecated int delNoCommit(*hash<auto> cond, *reference<string> sql);
3314 
3315 protected:
3316  int delIntern(*hash<auto> cond, *reference<string> sql, *hash<auto> opt, *reference<softlist<auto>> args);
3317 public:
3318 
3319 
3321 
3338  int updateCommit(hash<auto> set, hash<auto> cond, reference<string> sql, hash<auto> opt);
3339 
3340 
3342  int updateCommit(hash<auto> set, hash<auto> cond, reference<string> sql);
3343 
3344 
3346  int updateCommit(hash<auto> set, hash<auto> cond, hash<auto> opt);
3347 
3348 
3350  int updateCommit(hash<auto> set, hash<auto> cond);
3351 
3352 
3354  int updateCommit(hash<auto> set);
3355 
3356 
3358 
3375  int update(hash<auto> set, hash<auto> cond, reference<string> sql, hash<auto> opt);
3376 
3377 
3379  int update(hash<auto> set, hash<auto> cond, reference<string> sql);
3380 
3381 
3383  int update(hash<auto> set, hash<auto> cond, hash<auto> opt);
3384 
3385 
3387  int update(hash<auto> set, hash<auto> cond);
3388 
3389 
3391  int update(hash<auto> set);
3392 
3393 
3395 
3413  hash<SqlResultInfo> updateWithInfo(hash<auto> set, hash<auto> cond, *hash<auto> opt);
3414 
3415 
3417 
3429  hash<SqlCommandInfo> getUpdateSql(hash<auto> set, *hash<auto> cond);
3430 
3431 
3433  deprecated int updateNoCommit(hash<auto> set, *hash<auto> cond, *reference<string> sql);
3434 
3436  deprecated int updateNoCommit(hash<auto> set, *hash<auto> cond, *hash<auto> opt);
3437 
3438  private int updateIntern(hash<auto> set, *hash<auto> cond, *reference<string> sql, *hash<auto> opt,
3439  *reference<softlist<auto>> args) {
3440  hash<SqlCommandInfo> update_hash = getUpdateSql(set, cond);
3441  sql = update_hash.sql;
3442  args = update_hash.args;
3443  //printf("update_hash: %y\n", update_hash);
3444  return execData(opt, update_hash.sql, update_hash.args);
3445  }
3446 
3447 protected:
3448  string getUpdateExpression(string col, hash<UpdateOperatorInfo> uh);
3449 public:
3450 
3451 
3452 protected:
3453  bool emptyDataIntern();
3454 public:
3455 
3456 
3457 protected:
3458  Columns checkUpsertRow(hash<auto> row, reference<int> upsert_strategy);
3459 public:
3460 
3461 
3462 protected:
3463  code getUpsertInsertFirst(Columns cols, hash<auto> example_row, *hash<auto> opt);
3464 public:
3465 
3466 
3467 protected:
3468  code getUpsertUpdateFirst(Columns cols, hash<auto> example_row, *hash<auto> opt);
3469 public:
3470 
3471 
3472 protected:
3473  code getUpsertSelectFirst(Columns cols, hash<auto> example_row, *hash<auto> opt);
3474 public:
3475 
3476 
3477 protected:
3478  code getUpsertInsertOnly(Columns cols, hash<auto> example_row, *hash<auto> opt);
3479 public:
3480 
3481 
3482 protected:
3483  code getUpsertUpdateOnly(Columns cols, hash<auto> example_row, *hash<auto> opt);
3484 public:
3485 
3486 
3487 protected:
3488  Columns getUpsertColumns(reference<string> csrc);
3489 public:
3490 
3491 
3493 
3501 protected:
3502  hash<string, Columns> getAllUpsertColumns(*hash<auto> row);
3503 public:
3504 
3505 
3506 protected:
3507  bool matchUniqueColumns(Columns cols, hash<auto> row);
3508 public:
3509 
3510 
3511 protected:
3512  string getUpsertSelectSql(hash<auto> row, Columns cols, reference<list<string>> updc);
3513 public:
3514 
3515 
3516 protected:
3517  string getUpsertInsertSql(hash<auto> row);
3518 public:
3519 
3520 
3521 protected:
3522  string getUpsertUpdateSql(hash<auto> row, Columns cols, reference updc, *hash<auto> opt);
3523 public:
3524 
3525 
3526 protected:
3527  softbool tryUpdate(string sql, hash<auto> row, Columns cols, list updc);
3528 public:
3529 
3530 
3531 protected:
3532  checkValue(string cname, string argname, reference val, string type);
3533 public:
3534 
3535 
3537 
3546  string getSqlFromList(list<auto> l);
3547 
3548 
3550 
3561  string getSqlValue(auto v);
3562 
3563 
3565  string getName();
3566 
3567 
3569 
3576  cache(*hash<auto> opts);
3577 
3578 
3580 
3586 
3587 
3589 
3599  hash<auto> getDescriptionHash();
3600 
3601 
3603 
3611 
3612 
3614 
3623 
3624 
3626 
3636 
3637 
3638  *AbstractUniqueConstraint findUniqueConstraintUnlocked(string name);
3639 
3640 
3642 
3652 
3653 
3656 
3657 
3660 
3661 
3663 
3673 
3674 
3676 
3698  string getRenameSql(string new_name, *hash<auto> opt);
3699 
3700 
3702 
3711  string getCreateSqlString(*hash<auto> opt);
3712 
3713 
3715 
3724  list<auto> getCreateSql(*hash<auto> opt);
3725 
3726 
3728 
3739  string getCreateTableSql(*hash<auto> opt);
3740 
3741 
3743 
3748 
3749 
3750 protected:
3751  *hash<string, bool> getCheckOmissionOptions(*softlist<softstring> ol, string err);
3752 public:
3753 
3754 
3756 
3778  list<auto> getAlignSql(AbstractTable t, *hash<auto> opt);
3779 
3780 
3781 protected:
3782  list<auto> getAlignSqlUnlocked(AbstractTable t, *hash<auto> opt);
3783 public:
3784 
3785 
3786 protected:
3787  *AbstractColumnSupportingConstraint getSupportingConstraint(string ixname);
3788 public:
3789 
3790 
3791 protected:
3792  *list<AbstractColumnConstraint> getAllSupportingConstraints(string ixname);
3793 public:
3794 
3795 
3796 protected:
3797  renameIndexUnlocked(AbstractIndex ix, string new_name);
3798 public:
3799 
3800 
3802 
3815  string getAlignSqlString(AbstractTable t, *hash<auto> opt);
3816 
3817 
3819 
3831  *list<auto> getCreateIndexesSql(*hash<auto> opt, bool cache = True);
3832 
3833 
3835 
3847  *string getCreatePrimaryKeySql(*hash<auto> opt, bool cache = True);
3848 
3849 
3851 
3863  *list<auto> getCreateForeignConstraintsSql(*hash<auto> opt, bool cache = True);
3864 
3865 
3867 
3881  *list<auto> getCreateConstraintsSql(*hash<auto> opt, bool cache = True);
3882 
3883 
3885 
3897  *list<auto> getCreateMiscSql(*hash<auto> opt, bool cache = True);
3898 
3899 
3901 
3915  *list<auto> getCreateTriggersSql(*hash<auto> opt, bool cache = True);
3916 
3917 
3919 
3926  *hash find(auto id);
3927 
3928 
3930 
3941  *list find(list<auto> ids);
3942 
3943 
3944 protected:
3945  string getPrimaryKeyColumn();
3946 public:
3947 
3948 
3950 
3963  *hash<auto> find(hash<auto> row);
3964 
3965 
3967 
3980  *hash<auto> findSingle(*hash<auto> cond);
3981 
3982 
3984 
3997  *list<auto> findAll(*hash<auto> cond);
3998 
3999 
4001 
4005  string getDesc();
4006 
4007 
4009  string getBaseType();
4010 
4011 
4013  string getSqlName();
4014 
4015 
4017  string getColumnSqlName(string col);
4018 
4019 
4021  list<auto> getColumnSqlNames(softlist cols);
4022 
4023 
4025 
4028 
4029 
4031 
4035  *hash<string, AbstractDataField> getRecordType();
4036 
4037 
4039 
4048  AbstractDataField getColumnDataField(string column_name, *hash<auto> options, *string append_desc);
4049 
4050 
4052 
4060  AbstractDataField getColumnDataField(AbstractColumn column, *hash<SqlUtilDataTypeOptionInfo> options, *string append_desc);
4061 
4062 
4064 
4072  AbstractDataProviderType getColumnDataType(string column_name, *hash<SqlUtilDataTypeOptionInfo> options);
4073 
4074 
4076 
4078  AbstractDataProviderType getDbType(AbstractColumn column, *hash<SqlUtilDataTypeOptionInfo> options);
4079 
4080 
4082 
4084  AbstractDataProviderType getDbType(string native_type, *string qore_type, bool nullable, int max_size = -1,
4085  *hash<SqlUtilDataTypeOptionInfo> options) {
4086  hash<auto> type_options;
4087  if (nullable && options.mandatory);
4088 
4089  if (nullable && native_type[0] != '*');
4090 
4091  if (options.maxlen && (max_size < 0 || max_size > options.maxlen));
4092 
4093  if (!qore_type);
4094 
4095  switch (qore_type);
4096 
4097  }
4098 
4100 
4102  AbstractDataProviderType getNumericType(string type_name, bool nullable, *hash<auto> options);
4103 
4104 
4106 
4111 
4112 
4114 
4118  hash<auto> getExpressionMap();
4119 
4120 
4122 
4124  hash<auto> getWhereOperatorMap();
4125 
4126 
4128  abstract bool hasArrayBind();
4129 
4131 
4133 protected:
4134  hash<auto> getTableOptions();
4135 public:
4136 
4137 
4139 
4141 protected:
4143 public:
4144 
4145 
4147 
4149 protected:
4150  hash<auto> getConstraintOptions();
4151 public:
4152 
4153 
4155 
4157 protected:
4158  hash<auto> getCacheOptions();
4159 public:
4160 
4161 
4163 
4165 protected:
4167 public:
4168 
4169 
4171 
4173 protected:
4174  hash<auto> getAlignTableOptions();
4175 public:
4176 
4177 
4179 
4181 protected:
4183 public:
4184 
4185 
4187 
4189 protected:
4190  hash<auto> getColumnOptions();
4191 public:
4192 
4193 
4195 
4197 protected:
4198  hash<auto> getColumnDescOptions();
4199 public:
4200 
4201 
4203 
4205 protected:
4207 public:
4208 
4209 
4211 
4213 protected:
4214  hash<auto> getIndexOptions();
4215 public:
4216 
4217 
4219 
4221 protected:
4222  hash<auto> getTriggerOptions();
4223 public:
4224 
4225 
4227 
4229 protected:
4230  hash<auto> getSelectOptions();
4231 public:
4232 
4233 
4235 
4237 protected:
4238  hash<auto> getUpsertOptions();
4239 public:
4240 
4241 
4243 
4245 protected:
4246  hash<auto> getInsertOptions();
4247 public:
4248 
4249 
4251 
4253 protected:
4255 public:
4256 
4257 
4259 
4261 protected:
4263 public:
4264 
4265 
4267 
4269 protected:
4270  hash<auto> getColumnOperatorMap();
4271 public:
4272 
4273 
4275 protected:
4277 public:
4278 
4279 
4281 
4317  addCustomCopOperator(string name, hash<auto> operator);
4318 
4319 
4321 
4323  bool isDuplicateRowError(hash<ExceptionInfo> ex);
4324 
4325 
4327 
4329 protected:
4330  hash<auto> getInsertOperatorMap();
4331 public:
4332 
4333 
4335 
4337 protected:
4338  hash<auto> getUpdateOperatorMap();
4339 public:
4340 
4341 
4343 
4345 protected:
4347 public:
4348 
4349 
4351 
4353 protected:
4354  *hash<auto> getPseudoColumnHash();
4355 public:
4356 
4357 
4358 protected:
4359  string getCreateTableSqlUnlocked(*hash<auto> opt);
4360 public:
4361 
4362 
4363 protected:
4364  *list<auto> getCreateIndexesSqlUnlocked(*hash<auto> opt, bool cache = True);
4365 public:
4366 
4367 
4368 protected:
4369  *string getCreatePrimaryKeySqlUnlocked(*hash<auto> opt, bool cache = True);
4370 public:
4371 
4372 
4373 protected:
4374  *list<auto> getCreateConstraintsSqlUnlocked(*hash<auto> opt, bool cache = True);
4375 public:
4376 
4377 
4378 protected:
4379  *list<auto> getCreateForeignConstraintsSqlUnlocked(*hash<auto> opt, bool cache = True);
4380 public:
4381 
4382 
4383 protected:
4384  *list<auto> getCreateMiscSqlUnlocked(*hash<auto> opt, bool cache = True);
4385 public:
4386 
4387 
4388 protected:
4389  *list<auto> getCreateTriggersSqlUnlocked(*hash<auto> opt, bool cache = True);
4390 public:
4391 
4392 
4393 protected:
4394  list<auto> getCreateSqlUnlocked(*hash<auto> opt, bool cache = True);
4395 public:
4396 
4397 
4398 protected:
4399  cacheUnlocked(*hash<auto> opt);
4400 public:
4401 
4402 
4403 protected:
4404  auto execData(*hash<auto> opt, string sql, *list<auto> args);
4405 public:
4406 
4407 
4408 protected:
4409  execData(AbstractSQLStatement stmt, *hash<auto> opt, *list<auto> args);
4410 public:
4411 
4412 
4413  static AbstractTable getTable(AbstractDatasource nds, string nname, *hash<auto> opts);
4414 
4415  static AbstractTable getTable(string dsstr, string nname, *hash<auto> opts);
4416 
4417  static AbstractTable getTable(hash<auto> dsh, string nname, *hash<auto> opts);
4418 
4419 protected:
4420  getColumnsUnlocked();
4421 public:
4422 
4423 
4424 protected:
4425  getPrimaryKeyUnlocked();
4426 public:
4427 
4428 
4429  // also loads primary key and constraints (for unique constraints)
4430 protected:
4431  getIndexesUnlocked();
4432 public:
4433 
4434 
4435 protected:
4436  getForeignConstraintsUnlocked(*hash<auto> opt);
4437 public:
4438 
4439 
4440 protected:
4441  addSourceConstraint(string table_name, AbstractForeignConstraint fk);
4442 public:
4443 
4444 
4445 protected:
4446  getConstraintsUnlocked();
4447 public:
4448 
4449 
4450 protected:
4451  getTriggersUnlocked();
4452 public:
4453 
4454 
4456 protected:
4458 public:
4459 
4460 
4461 protected:
4462  softlist<auto> getDropSqlImpl();
4463 public:
4464 
4465 
4466 protected:
4467  string getTruncateSqlImpl();
4468 public:
4469 
4470 
4472 protected:
4473  auto tryExecArgsImpl(string sql, *softlist<auto> args);
4474 public:
4475 
4476 
4478 protected:
4479  auto tryExecRawImpl(string sql);
4480 public:
4481 
4482 
4484 protected:
4486 public:
4487 
4488 
4489 protected:
4490  preSetupTableImpl(reference desc, *hash<auto> opt);
4491 public:
4492 
4493 
4495 
4497 protected:
4498  abstract AbstractDataProviderType getNumericTypeImpl(string type_name, bool nullable, *hash<auto> options);
4499 public:
4500 
4501 protected:
4502  abstract *hash<auto> doReturningImpl(hash<auto> opt, reference<string> sql, list<auto> args);
4503 public:
4504 
4505 protected:
4506  abstract bool emptyImpl();
4507 public:
4508 
4510 protected:
4511  abstract *string getSqlValueImpl(auto v);
4512 public:
4513 
4515 
4518 protected:
4519  abstract bool checkExistenceImpl();
4520 public:
4521 
4523 protected:
4524  abstract bool supportsTablespacesImpl();
4525 public:
4526 
4528 protected:
4530 public:
4531 
4533 protected:
4535 public:
4536 
4537 protected:
4538  abstract setupTableImpl(hash<auto> desc, *hash<auto> opt);
4539 public:
4540 
4541 protected:
4542  abstract Columns describeImpl();
4543 public:
4544 protected:
4545  abstract AbstractPrimaryKey getPrimaryKeyImpl();
4546 public:
4547 protected:
4548  abstract Indexes getIndexesImpl();
4549 public:
4550 protected:
4551  abstract ForeignConstraints getForeignConstraintsImpl(*hash<auto> opt);
4552 public:
4553 protected:
4554  abstract Constraints getConstraintsImpl();
4555 public:
4556 protected:
4557  abstract Triggers getTriggersImpl();
4558 public:
4559 
4560 protected:
4561  abstract string getCreateTableSqlImpl(*hash<auto> opt);
4562 public:
4563 protected:
4564  abstract *list<auto> getCreateMiscSqlImpl(*hash<auto> opt, bool cache);
4565 public:
4566 protected:
4567  abstract string getCreateSqlImpl(list<auto> l);
4568 public:
4569 protected:
4570  abstract string getRenameSqlImpl(string new_name);
4571 public:
4572 protected:
4573  abstract *list<auto> getAlignSqlImpl(AbstractTable t, *hash<auto> opt);
4574 public:
4575 
4576 protected:
4577  abstract AbstractColumn addColumnImpl(string cname, hash<auto> opt, bool nullable = True);
4578 public:
4579 protected:
4580  abstract AbstractPrimaryKey addPrimaryKeyImpl(string cname, hash<auto> ch, *hash<auto> opt);
4581 public:
4582 protected:
4583  abstract AbstractIndex addIndexImpl(string iname, bool enabled, hash<auto> ch, *hash<auto> opt);
4584 public:
4585 protected:
4586  abstract AbstractForeignConstraint addForeignConstraintImpl(string cname, hash<auto> ch, string table, hash<auto> tch, *hash<auto> opt);
4587 public:
4588 protected:
4589  abstract AbstractCheckConstraint addCheckConstraintImpl(string cname, string src, *hash<auto> opt);
4590 public:
4591 protected:
4592  abstract AbstractUniqueConstraint addUniqueConstraintImpl(string cname, hash<auto> ch, *hash<auto> opt);
4593 public:
4594 
4595 protected:
4596  abstract AbstractTrigger addTriggerImpl(string tname, string src, *hash<auto> opt);
4597 public:
4598 
4600 protected:
4601  abstract bool tryInsertImpl(string sql, hash<auto> row);
4602 public:
4603 
4605 protected:
4606  abstract hash<auto> getQoreTypeMapImpl();
4607 public:
4608 
4610 protected:
4611  abstract hash<auto> getTypeMapImpl();
4612 public:
4613 
4615  private abstract doSelectOrderByWithOffsetSqlUnlockedImpl(reference<hash<QueryInfo>> info, reference<string> sql,
4616  list<auto> coll);
4617 
4619 protected:
4620  abstract doSelectLimitOnlyUnlockedImpl(reference<hash<QueryInfo>> info, reference<string> sql);
4621 public:
4622 
4624 protected:
4625  abstract copyImpl(AbstractTable old);
4626 public:
4627 
4629 
4633 protected:
4635 public:
4636 
4638 
4640 protected:
4641  abstract bool isDuplicateRowErrorImpl(hash<ExceptionInfo> ex);
4642 public:
4643 };
4644 };
abstract auto getValue()
abstract bool next()
abstract class for check constraints
Definition: SqlUtil.qm.dox.h:6717
the base class for column information
Definition: SqlUtil.qm.dox.h:6346
abstract list< auto > getAddColumnSql(AbstractTable t)
returns a list of sql strings that can be used to add the column to an existing table
the API for a constraint with columns
Definition: SqlUtil.qm.dox.h:6770
abstract base class for constraints
Definition: SqlUtil.qm.dox.h:6655
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:6930
bool hasKey(string k)
Returns True if the key exists in the contained hash (may or may not be assigned a value),...
Qore::AbstractIterator keyIterator()
Returns a HashKeyIterator object for the contained hash.
the abstract base class for index information
Definition: SqlUtil.qm.dox.h:6525
represents a primary key
Definition: SqlUtil.qm.dox.h:6853
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
transient AbstractDatasource ds
the connection to the database server
Definition: AbstractSqlUtilBase.qc.dox.h:37
*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
const UR_Updated
row was updated because it was different (only possible with UpsertSelectFirst)
Definition: AbstractTable.qc.dox.h:339
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()
const UpsertUpdateFirst
Upsert option: update first, if the update fails, then insert.
Definition: AbstractTable.qc.dox.h:271
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
const UpsertStrategyMap
hash mapping upsert strategy codes to a text description
Definition: AbstractTable.qc.dox.h:306
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
Definition: AbstractTable.qc.dox.h:2349
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,...
const UpsertInsertOnly
Upsert option: insert if the row does not exist, otherwise ignore.
Definition: AbstractTable.qc.dox.h:294
hash< auto > getTableCreationOptions()
returns the table creation options for this driver
const UpsertInsertFirst
Upsert option: insert first, if the insert fails, then update.
Definition: AbstractTable.qc.dox.h:263
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...
Definition: AbstractTable.qc.dox.h:2398
const UR_Verified
row was updated unconditionally (not returned with UpsertSelectFirst)
Definition: AbstractTable.qc.dox.h:336
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.
Definition: AbstractTable.qc.dox.h:2404
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
Definition: AbstractTable.qc.dox.h:2410
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...
const UpsertUpdateOnly
Upsert option: update if the row exists, otherwise ignore.
Definition: AbstractTable.qc.dox.h:301
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
Definition: AbstractTable.qc.dox.h:4084
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...
Definition: AbstractTable.qc.dox.h:2216
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.
Definition: AbstractTable.qc.dox.h:1938
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.
Definition: AbstractTable.qc.dox.h:2222
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...
const UpsertAuto
Upsert option: if the target table is empty, use UpsertInsertFirst, otherwise use UpsertUpdateFirst.
Definition: AbstractTable.qc.dox.h:287
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.
Definition: AbstractTable.qc.dox.h:2340
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
const UpsertStrategyDescriptionMap
hash mapping upsert strategy descriptions to upsert strategy codes
Definition: AbstractTable.qc.dox.h:318
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...
Definition: AbstractTable.qc.dox.h:2175
hash< auto > getTableColumnDescOptions()
returns the table column description options for this driver
*hash< auto > getPseudoColumnHash()
returns a hash of valid pseudocolumns
abstract private 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
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
const UpsertSelectFirst
Upsert option: select first, if the row is unchanged, do nothing, if it doesn't exist,...
Definition: AbstractTable.qc.dox.h:280
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
const UR_Deleted
row was deleted (only possible with batch upsert methods such as AbstractTable::upsertFromIterator() ...
Definition: AbstractTable.qc.dox.h:345
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.
Definition: AbstractTable.qc.dox.h:2416
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
*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 UR_Inserted
row was inserted
Definition: AbstractTable.qc.dox.h:333
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)
const UR_Unchanged
row was unchanged (only possible with UpsertSelectFirst, UpsertInsertOnly, and UpsertUpdateOnly)
Definition: AbstractTable.qc.dox.h:342
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...
Definition: AbstractTable.qc.dox.h:1930
*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:7128
represents a unique column constraint
Definition: SqlUtil.qm.dox.h:6844
column container class that throws an exception if an unknown column is accessed
Definition: SqlUtil.qm.dox.h:6264
constraint container class that throws an exception if an unknown constraint is accessed
Definition: SqlUtil.qm.dox.h:6613
foreign constraint container class that throws an exception if an unknown constraint is accessed
Definition: SqlUtil.qm.dox.h:6864
index container class that throws an exception if an unknown index is accessed
Definition: SqlUtil.qm.dox.h:6479
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:6076
trigger container class that throws an exception if an unknown trigger is accessed
Definition: SqlUtil.qm.dox.h:7146
const True
const False
number exp(number n)
bool exists(...)
string sprintf(string fmt,...)
const NothingType
const Hash
const String
const Boolean
const Int
const NT_STRING
hash< auto > hash(object obj)
string type(auto arg)
list< auto > list(...)
const AbstractDataProviderTypeMap
Qore AbstractDatabase class definition.
Definition: AbstractDatabase.qc.dox.h:26
Query information.
Definition: SqlUtil.qm.dox.h:2667